Getting started
Installation
Install the package, publish the config, and run the migrations.
composer require usamamuneerchaudhary/commentify
php artisan vendor:publish --tag=commentify-config
php artisan migrate
Livewire 4 and Flux come with the package. You need PHP 8.2+ and Laravel 12 or 13.
Add the Commentable trait to any model that should receive comments:
use Usamamuneerchaudhary\Commentify\Traits\Commentable;
class Post extends Model
{
use Commentable;
}
Then drop the Livewire component into the view that renders it.
<livewire:comments :model="$article" />
That is the whole integration. Everything after this page is configuration: guests, markdown, likes, reporting, and (with Pro) the JSON API, React, Vue, spam, and Filament.
Page notes (3)
Or Log in to comment!
Free crypto signals, guaranteed 40% weekly returns, message me at http://not-a-real-scam.example.com and http://also-fake.example.org right now!!
Suggestion: mention that
migratepicks up the package migrations automatically, so there is novendor:publish --tag=commentify-migrationsstep unless you want to edit them. I published them out of habit and ended up with duplicates.Might be worth saying explicitly that
$articlehas to be an Eloquent model instance, not an ID. I passed an ID first and the error message was not obvious.