| Install | |
|---|---|
composer require centrex/livewire-comments |
|
| Latest Version: | v2.0.0 |
| PHP: | ^8.2|^8.3|^8.4 |
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
IP & UserAgent)You can install the package via composer:
composer require centrex/livewire-comments
You can run the migrations with:
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="comments-config"
you can publish tailwind.config.js file,
This package utilizes TailwindCSS, and use some custom configurations. You can publish package's tailwind.config. js file by running the following command:
php artisan vendor:publish --tag="comments-tailwind-config"
In your model, where you want to integrate comments, simply add the Commentable trait in that model.
For example:
use Centrex\LivewireComments\Traits\Commentable;
class Article extends Model
{
use Commentable;
}
Next, in your view, pass in the livewire comment component. For example, if your view file is articles/show.blade. php. We can add the following code:
<livewire:comments :model="$article"/>
HasUserAvatar trait in App\Models\User, to use avatars:use Centrex\LivewireComments\Traits\HasUserAvatar;
class User extends Model
{
use HasUserAvatar;
}
🧹 Keep a modern codebase with Pint:
composer lint
✅ Run refactors using Rector
composer refacto
⚗️ Run static analysis using PHPStan:
composer test:types
✅ Run unit tests using PEST
composer test:unit
🚀 Run the entire test suite:
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.