{"id":21141883,"url":"https://github.com/matthewbdaly/laravel-comments","last_synced_at":"2026-03-04T10:31:22.009Z","repository":{"id":62525231,"uuid":"113365255","full_name":"matthewbdaly/laravel-comments","owner":"matthewbdaly","description":"Comments package for Laravel","archived":false,"fork":false,"pushed_at":"2018-10-28T12:38:59.000Z","size":55,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-05T18:52:23.492Z","etag":null,"topics":["comments","laravel","laravel-5-package","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthewbdaly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-06T20:42:12.000Z","updated_at":"2023-11-10T23:28:25.000Z","dependencies_parsed_at":"2022-11-02T14:01:48.313Z","dependency_job_id":null,"html_url":"https://github.com/matthewbdaly/laravel-comments","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/matthewbdaly/laravel-comments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbdaly%2Flaravel-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbdaly%2Flaravel-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbdaly%2Flaravel-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbdaly%2Flaravel-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewbdaly","download_url":"https://codeload.github.com/matthewbdaly/laravel-comments/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbdaly%2Flaravel-comments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30078308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comments","laravel","laravel-5-package","php"],"created_at":"2024-11-20T07:38:13.570Z","updated_at":"2026-03-04T10:31:21.989Z","avatar_url":"https://github.com/matthewbdaly.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-comments\n\n[![Build Status](https://travis-ci.org/matthewbdaly/laravel-comments.svg?branch=master)](https://travis-ci.org/matthewbdaly/laravel-comments)\n[![Coverage Status](https://coveralls.io/repos/github/matthewbdaly/laravel-comments/badge.svg?branch=master)](https://coveralls.io/github/matthewbdaly/laravel-comments?branch=master)\n\nSimple comments system, loosely inspired by Django's comments system. Allows comments to be attached to an object, and allows for them to be flagged by users for moderator attention.\n\nInstallation\n------------\n\n```\ncomposer require matthewbdaly/laravel-comments\n```\n\nYou will also need to run `php artisan migrate` to set up the required database tables.\n\nUsage\n-----\n\nTo allow comments to be attached to an object, add the trait `Matthewbdaly\\LaravelComments\\Eloquent\\Traits\\Commentable` to it. The object will then have a `comments` polymorphic relation.\n\nViews\n-----\n\nThe package includes a view for submitting comments, named `comments::comments`, which can be included in another view as follows:\n\n```php\n@include('comments::comments', ['parent' =\u003e $post])\n```\n\nThe value of `parent` must be an instance of the commentable object (eg, a blog post). The view also includes a form for flagging comments.\n\nObviously, if you prefer you can override this view with your own content.\n\nThe package also includes the following views:\n\n* `comments::commentsubmitted`\n* `comments::flagsubmitted`\n\nThese simply acknowledge receipt of the comment or flag, but are fairly basic and so you should feel free to replace them as you see fit.\n\nOf course there's nothing stopping you creating your own routes and controllers for creating, viewing and flagging comments, and if you wish to build a REST API that allows for adding comments to objects you can just use these models directly:\n\n* `Matthewbdaly\\LaravelComments\\Eloquent\\Models\\Comment`\n* `Matthewbdaly\\LaravelComments\\Eloquent\\Models\\Comment\\Flag`\n\nI recommend that you use my repositories, which are as follows:\n\n* `Matthewbdaly\\LaravelComments\\Contracts\\Repositories\\Comment`\n* `Matthewbdaly\\LaravelComments\\Contracts\\Repositories\\Comment\\Flag`\n\nThese use `matthewbdaly/laravel-repositories` and so implement caching on the decorated repository, making it simple to ensure your models get cached appropriately.\n\nEvents\n------\n\nYou can set up listeners for the following events:\n\n* `Matthewbdaly\\LaravelComments\\Events\\CommentBeingReceived`\n\nFired before the comment is saved. The package does not validate comments out of the box, but you can use this to validate the comment using whatever method you wish (eg check it with Akismet, check for links), or process it before saving (eg run it through a Markdown parser).\n\n* `Matthewbdaly\\LaravelComments\\Events\\CommentReceived`\n\nFired when a new comment is submitted. This is useful for creating some sort of notification, such as an SMS, email, push notification etc.\n\n* `Matthewbdaly\\LaravelComments\\Events\\CommentBeingFlagged`\n\nFired before a comment flag is saved. Useful for processing the flag to amend it before saving it.\n\n* `Matthewbdaly\\LaravelComments\\Events\\CommentFlagged`\n\nThis event fires after a comment has been flagged for moderator attention. You can use this event to send whatever notification is most appropriate (eg, email, Slack, SMS).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewbdaly%2Flaravel-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewbdaly%2Flaravel-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewbdaly%2Flaravel-comments/lists"}