spatie / laravel-comments
Associate comments and reactions with Eloquent models
Fund package maintenance!
spatie
Requires
- php: ^8.1
- illuminate/contracts: ^8.73
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^5.10
- nunomaduro/larastan: ^1.0
- orchestra/testbench: ^6.22
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-markdown: ^2.1
- spatie/laravel-ray: ^1.26
- spatie/pest-plugin-snapshots: ^1.1
Suggests
- spatie/laravel-markdown: Required to convert markdown to HTML
README
Using this package, you can create comments and associate them with Eloquent models.
Here's how you can create a comment for the currently logged in user.
$yourModel->comment('This my comment');
Here's how to retrieve them all;
$comments = $yourModel->comments $comment->text // returns "This is my comment"
You can also react to a comment
$comment->react('👍');
Using the Livewire components, you can quickly add comments to the UI of your app.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Documentation
All documentation is available on our documentation site.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.