{"repo":"beyondcode/laravel-comments","free":true,"listed":false,"github":"https://github.com/beyondcode/laravel-comments","clone":"git clone https://github.com/beyondcode/laravel-comments.git","description":"Add comments to your Laravel application","language":"PHP","stars":602,"topics":["laravel","comments"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Add comments to your Laravel application Add the ability to associate comments to your Laravel Eloquent models. The comments can be approved and nested. Installation You can install the package via composer: The package will automatically register itself. You can publish the migration with: After the migration has been published you can create the media-table by running the migrations: You can publish the config-file with: Usage Registering Models To let your models be able to receive comments, add the HasComments trait to the model classes. Creating Comments To create a comment on your commentable models, you can use the comment method. It receives the string of the comment that you want to store. The comment method returns the newly created comment class. Sometimes you also might want to create comments on behalf of other users. You can do this using the commentAsUser method and pass in your user model that should get associated with this comment: Approving Comments By default, all comments that you create are not approved - this is just a boolean flag called is approved that you can use in your views/controllers to filter out comments that you might not yet want to display. To approve a single comment, you may use the approve method on the Comment model like this: Auto Approve Comments If you want to automatically approve a comment for a specific user (and optionally model) you can let your User model implement the following interface and method: The needsCommentApproval m","default_branch":null,"files":null,"tree":[],"storefront":"/r/beyondcode","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/beyondcode/laravel-comments/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}