This package provides a simple way to add comments to your Laravel application.
Run the following command from your project directory to add the dependency:
composer require mkaverin/laravel-comments
Then, copy and run database migrations:
php artisan vendor:publish --provider="Comments\Providers\CommentsServiceProvider" --tag=migrations
php artisan migrate
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
:
'providers' => [
...
Comments\Providers\CommentsServiceProvider::class,
],
You can copy the package config with the publish command:
php artisan vendor:publish --provider="Comments\Providers\CommentsServiceProvider"
You can find published config in config/comments.php
.
The model you want to attach comments to must use the Comments\Traits\HasComments
trait.
composer test