Laravel Review Rateable is an MIT-licensed package for attaching written reviews and multiple rating criteria to any Eloquent model. Core provides the review engine and APIs; your application owns its interface, authentication, authorization, and upload flow.
Core documentation · Live demo · Packagist
Upgrading from v1? Version 2 is an architectural rewrite, not an in-place upgrade. Plan a data migration and update your integration to the new trait and service contract. See the installation guide.
- Reviews and multiple configurable rating criteria on any Eloquent model
- Departments with their own rating keys and labels
- Approval controls and approved-review queries
- Optional, ordered review images with application-supplied thumbnails
- Averages, distributions, counts, and a decoupled service contract
Core is complete, MIT licensed, and works independently. ReviewRateable Pro is an optional commercial companion built on the same review data. It adds ready-made Livewire, React, and Vue interfaces plus moderation, replies, invitations, verified reviews, helpful voting, and other application workflows.
- PHP 8.1 or higher, subject to your Laravel version's PHP requirements
- Laravel 10, 11, 12, or 13
- Compatible numeric IDs for reviewable models and users; the current Core schema does not support UUID identity
In your Laravel application:
composer require codebyray/laravel-review-rateable:^2.2
php artisan vendor:publish --provider="Codebyray\ReviewRateable\ReviewRateableServiceProvider" --tag=config
php artisan vendor:publish --provider="Codebyray\ReviewRateable\ReviewRateableServiceProvider" --tag=migrations
php artisan migrateLaravel discovers the service provider automatically. Publish each migration once; publishing again can create duplicate timestamped migrations. Review images use a separate opt-in migration, so the basic installation creates only reviews and ratings tables.
For upgrades, configuration, and production considerations, see the full installation guide.
Add the trait to a saved Eloquent model:
namespace App\Models;
use Codebyray\ReviewRateable\Traits\ReviewRateable;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use ReviewRateable;
}Then create a review using keys from the configured default department:
$review = $product->addReview([
'review' => 'Comfortable and well made.',
'department' => 'default',
'recommend' => true,
'ratings' => [
'overall' => 5,
'customer_service' => 5,
'quality' => 5,
'price' => 4,
],
], auth()->id());
$publishedReviews = $product->getReviews(); // Approved reviews with ratings.In an HTTP endpoint, authenticate the author, authorize the product, and validate the text and configured rating keys before calling addReview(). New reviews are unapproved by default. See the review API guide for a controller example, updates, approval, deletion, and the injectable service.
The Core documentation is the maintained reference for configuration, review queries and statistics, and review images, galleries, and file lifecycle.
composer testCore is MIT licensed. Bug reports, questions, and contributions are welcome through GitHub issues.