fawad / laravel-comments
A Laravel package that provides a TALL-stack powered comment system with replies, attachments, and voting.
Requires
- livewire/livewire: ^3.0
README
A lightweight yet powerful comment system for Laravel that works seamlessly with any type of post β blog articles, videos, audios, or custom content.
This package allows your users to engage with your content effortlessly, while giving you full flexibility and customization options. π
β¨ Features
- π Add comments to any model (posts, videos, audios, or custom entities).
- π¨ Beautiful, ready-to-use frontend UI out of the box.
- β‘ Quick installation β just one line of code to show comments.
- ποΈ Configurable settings β publish the vendor file and tweak it your way.
- π οΈ Built with Laravel + Livewire, making it dynamic and reactive.
- π€ Open for contributions β improve and extend together.
βοΈ Requirements
To use this package, make sure your project meets the following minimum requirements:
- PHP: >= 8.2
- Laravel: >= 11.x
- Livewire: >= 3.x
π¦ Installation
Clone the package into your Laravel project:
composer require fawad/laravel-comments
Or install directly from GitHub:
git clone https://github.com/fadi06/comment-system.git
βοΈ Publish Vendor Files
To customize the configuration, publish the vendor files:
php artisan vendor:publish --tag="comment-config"
Next Step:
php artisan vendor:publish --tag="comment-view"
βοΈ Run Migrations
To run migration run the below command
php artisan migrate
Next Step:
npm run build
or add cdn link
<script src="https://cdn.tailwindcss.com"></script>
π Usage
Adding the comment system to your project is super simple.
Just drop this line into your Blade file (e.g., under your blog post):
<livewire:comments :model="$post" />
Thatβs it! π
Now every post will have its own dynamic comment section.
π§ Configuration
Once published, you can edit the config file to:
- Change table names
- Customize views
- Adjust behavior according to your needs
π‘ Example
Add comments under your blog posts like this:
// Inside your controller $post = Post::findOrFail($id); return view('post.show', compact('post'));
{{-- Inside your Blade --}} <livewire:comments :model="$post" />
Now your users can start commenting on posts instantly.
π€ Contributing
Contributions are warmly welcome!
If youβd like to add features, fix bugs, or improve documentation:
- Fork the repository
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request
------------------------------ Thank you ------------------------------