laravel-commentable maintained by akira
Description
Commentable is a lightweight and flexible comment system package designed to seamlessly integrate into any Laravel project. Whether you’re building a blog, a forum, or a platform like DevHunter – this package makes it incredibly easy to make any model commentable.
Author
Last update
2026/06/11 17:23
(1.x-dev)
License
Downloads
662
Tags
Laravel Commentable is a lightweight comment system for Laravel applications. It adds comments, replies, reactions, and moderation to Eloquent models through small, typed traits.
Install
composer require akira/laravel-commentable
{
"require": {
"akira/laravel-commentable": "^0.2"
}
}
Publish and run the migrations:
php artisan vendor:publish --tag="commentable-migrations"
php artisan migrate
Publish the config when you need custom table or model classes:
php artisan vendor:publish --tag="commentable-config"
Quick start
use Akira\Commentable\Concerns\Commentable;
use Akira\Commentable\Concerns\Commenter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
final class Post extends Model
{
use Commentable;
}
final class User extends Authenticatable
{
use Commenter;
}
$comment = $user->comment($post, 'Laravel 13 support is ready.');
$reply = $user->reply($comment, 'Confirmed with the package test suite.');
$post->comments()->where('approved', true)->get();
Documentation
- Roadmap
- Installation
- Basic usage
- Advanced features
- Configuration
- API reference
- Database schema
- Testing
- Examples
- Troubleshooting
- API reference: https://packages.akira-io.com/packages/laravel-commentable
Testing
composer test
Changelog
Please see CHANGELOG.md for what has changed recently. The changelog is generated from conventional commits via git-cliff on every release tag.
Contributing
Please see CONTRIBUTING.md for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see LICENSE.md for more information.