Review & Rating system for Laravel 10, 11, 12 & 13
codebyray/laravel-review-rateable is a Laravel package for review & rating system for laravel 10, 11, 12 & 13.
It currently has 310 GitHub stars and 365.390 downloads on Packagist (latest version v2.3.0).
Install it with composer require codebyray/laravel-review-rateable.
Discover more Laravel packages by codebyray
or browse all Laravel packages to compare alternatives.
Last updated
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.
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.
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 migrate
Laravel 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.
To build a distribution or filter for one criterion, use the key-aware query helpers:
$overallCounts = $product->ratingCountsForKey('overall', 'default');
$overallStats = $product->ratingStatsForKey('overall', 'default');
$fiveStarOverallReviews = $product->getReviewsByRatingForKey(5, 'overall', 'default');
The same helpers are available from the injectable CriterionRatingContract after calling setModel($product). This extended contract preserves compatibility with existing ReviewRateableContract implementations. The counts and statistics include approved reviews by default; pass approved: false for private pending-review queries. Pass null as the department to count a key across all departments. The existing ratingCounts(), ratingStats(), and getReviewsByRating() methods keep their all-criteria behavior.
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 test
Core is MIT licensed. Bug reports, questions, and contributions are welcome through GitHub issues.