Any Eloquent model
Attach feedback to products, posts, services, bookings, or your own model through a polymorphic relationship and a simple trait.
Attach reviews, configurable ratings, recommendations, and optional photos to any Eloquent model. Core gives you the complete backend without imposing a storefront, CSS framework, or hosted service.
composer require codebyray/laravel-review-rateable:^2.2
php artisan vendor:publish \
--provider="Codebyray\ReviewRateable\ReviewRateableServiceProvider" \
--tag=migrations
php artisan migrate
Every backend capability below is free and production-ready. Pro adds interfaces and advanced workflows without moving or replacing your Core data.
Attach feedback to products, posts, services, bookings, or your own model through a polymorphic relationship and a simple trait.
Define rating keys such as overall, quality, service, or value with application-specific labels and scoring ranges.
Give sales, support, or other contexts independent rating criteria and department-scoped review queries.
Keep new reviews pending or approve immediately. Create, update, approve, and delete reviews through the PHP API.
Add, remove, and reorder images. Configure disk, directory, MIME types, file size, and count only when your app needs photos.
Retrieve averages by criterion or department, totals, distributions, and percentages, with filters for approval and rating values.
Use original and thumbnail URL helpers, eager-load images, and safely clean up stored files after database commits.
Work through the Eloquent trait or injectable service contract, configure your user model, and keep control of authorization and UI.
Core is intentionally headless. Add the trait, choose your rating criteria, and render the result with Blade, an API, or any front-end stack you already use.
Build your first reviewable model →use Codebyray\ReviewRateable\Traits\ReviewRateable;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use ReviewRateable;
}
$review = $product->addReview([
'review' => 'My new everyday favorite.',
'recommend' => true,
'ratings' => ['overall' => 5, 'quality' => 4],
], auth()->id());Core's photo support is included free, but its table is published separately. Applications that do not need images never create it.
Install the review-images migration only for applications that accept customer photos.
Choose storage disk, directory, file size, image count, MIME types, and URL behavior.
Core provides ordered images and URL helpers while leaving the gallery, modal, and CSS to your app.
Pro installs Core automatically and adds interfaces, moderation, customer engagement, and team workflows on the same data model.