Download the PHP package fiachehr/laravel-comments-pro without Composer
On this page you can find all versions of the php package fiachehr/laravel-comments-pro. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fiachehr/laravel-comments-pro
More information about fiachehr/laravel-comments-pro
Files in fiachehr/laravel-comments-pro
Package laravel-comments-pro
Short Description Production-ready comments system for Laravel: nested threads, reactions, guest & user support, polymorphic models, moderation, rate limiting
License MIT
Homepage https://github.com/fiachehr/laravel-comments-pro
Informations about the package laravel-comments-pro
Laravel Comments Pro
A comprehensive, feature-rich comments system for Laravel applications with support for nested comments, reactions, guest users, and advanced moderation features.
๐ Documentation (fiachehr.ir)
Full guide with examples and IDE-style code blocks: Laravel Comments Pro โ Documentation
๐ Requirements
PHP Version
- PHP >= 8.1 (Required)
- PHP 8.1, 8.2, 8.3, 8.4 (Supported)
Laravel Version
- Laravel 10.x (LTS)
- Laravel 11.x
- Laravel 12.x
Compatibility Matrix
| PHP Version | Laravel 10.x | Laravel 11.x | Laravel 12.x |
|---|---|---|---|
| 8.1 | โ Supported | โ | โ |
| 8.2 | โ Supported | โ Supported | โ Supported |
| 8.3 | โ Supported | โ Supported | โ Supported |
| 8.4 | โ Supported | โ Supported | โ Supported |
Laravel 11 and 12 require PHP 8.2 or higher. Use PHP 8.1 only with Laravel 10.
Framework Dependency
โ ๏ธ This package is Laravel-specific and requires:
- Eloquent ORM - Database models and relationships
- Laravel Facades - Service access layer
- Laravel Service Providers - Package registration
- Laravel Events - Event system integration
- Laravel Migrations - Database schema management
- Laravel Artisan - Command-line interface
Not compatible with other frameworks (Symfony, CodeIgniter, etc.)
โจ Features
- Nested Comments - Unlimited depth with configurable limits
- Reactions System - Like/Dislike functionality with statistics
- Guest Support - Allow anonymous users to comment
- Moderation Tools - Approve/reject comments with status management
- Event System - Fire events for comment creation, approval, and reactions
- Tree Structure - Convert flat comments to hierarchical tree
- Guest Fingerprinting - Track guest users without authentication
- Bulk Operations - Handle multiple comments and reactions efficiently
- Popular Comments - Get trending comments based on reactions
- Soft Deletes - Safe comment deletion with recovery options
- Factory Support - Built-in factories for testing
- Comprehensive Testing - Full test suite included
๐ฆ Installation
Prerequisites
Before installing, ensure you have:
- PHP >= 8.1 (PHP 8.2+ for Laravel 11 or 12)
- Laravel 10, 11, or 12
- Composer installed
1. Install via Composer
Note: This package requires Laravel framework and is not compatible with other PHP frameworks.
2. Publish and Run Migrations
3. Publish Configuration
๐ Quick Start
1. Add Trait to Any Model
2. Create Comments
3. Approve Comments
4. Add Reactions
5. Get Comments as Tree
โ๏ธ Configuration
Comments Configuration
Per-model settings are not defined on the trait; adjust behavior in config/comments.php (or override config per environment).
๐ง Advanced Usage
Service Classes
Events
Scopes and Relationships
Bulk Operations
๐ฏ API Examples
Controller Implementation
Request Validation
๐งช Testing
Run Tests
Using with Laravel Artisan
If you want to use php artisan test in your Laravel project, add this to your phpunit.xml:
Then run: php artisan test --testsuite=Comments
Test Results
- โ 46 tests - All passing
- โ 96 assertions - Full coverage
- โ 3 test files - Core, Functional, Package tests
๐ Security Features
- CSRF Protection - Built-in CSRF token validation
- Rate Limiting - Configurable rate limits for comments
- Spam Protection - Built-in spam detection
- Guest Fingerprinting - Secure guest user tracking
- Input Validation - Comprehensive validation rules
- SQL Injection Protection - Eloquent ORM protection
๐จ Frontend Integration
Vue.js Example
React Example
๐ Performance Optimization
Database Indexing
Caching
Eager Loading
๐ง Troubleshooting
Common Issues
-
Compatibility Issues
-
Migration Errors
-
Factory Not Found
-
Event Not Firing
- Framework Compatibility
Debug Mode
๐ Monitoring
Analytics
Health Checks
๐ค Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This package is open-sourced software licensed under the MIT license.
๐ Support
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
๐ Acknowledgments
- Laravel Framework
- Eloquent ORM
- PHP Community
- All contributors and testers
Made with โค๏ธ by Fiachehr
All versions of laravel-comments-pro with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/events Version ^10.0|^11.0|^12.0