Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Review Rating

Laravel Review Rating Laravel Package

digikraaft/laravel-review-rating

Add star ratings and written reviews to any Laravel model with a simple trait. Digikraaft's package lets users rate and review Eloquent models, calculates average ratings, and stores reviews in a clean, configurable schema—easy to drop into existing apps.

View on GitHub
Deep Wiki
Context7

Review & Rating system for Laravel

Frequently asked questions about Laravel Review Rating
How do I install digikraaft/laravel-review-rating in a Laravel app?
Install it with Composer using composer require digikraaft/laravel-review-rating. Then publish the package's migrations and configuration with the vendor:publish command and run php artisan migrate to create the reviews table. After that, add the provided trait to any Eloquent model you want users to rate. Check the README for the exact publish tags and trait namespace for your version.
Which Laravel versions does digikraaft/laravel-review-rating support?
Version 3.2.x supports Laravel 11 and Laravel 12, and it drops Laravel 10 entirely. On a Laravel 10 application, Composer dependency resolution will fail against the ^3.2 constraint. If you are still on Laravel 10, pin the package to the last 3.1.x release until the host application is upgraded.
What PHP version does laravel-review-rating require?
The 3.2.x line follows Laravel 12's PHP floor, so you need PHP 8.2 or newer. Environments running PHP 8.1 will hit a second, independent Composer blocker even if the framework version is otherwise fine. Confirm PHP 8.2+ in local, CI, and production images before bumping the constraint.
How do I add star ratings and reviews to an Eloquent model?
The package is trait-based: you add its trait to the model you want reviewed, and that model then accepts ratings and written reviews stored in the package's schema. This lets you attach reviews to posts, products, users, or any other Eloquent model without writing your own review tables. See the README for the trait name and the relationship methods it exposes.
How does the package calculate average ratings?
It aggregates the stored star ratings for a model and exposes the average so you can display it without writing your own query. The exact accessor or method name is documented in the README, so confirm it against your installed version before wiring it into views. If you need caching for high-traffic pages, wrap the average lookup in your own cache layer.
Do I need to publish the config and migrations for laravel-review-rating?
Yes. The package ships a configurable schema, so you publish the migrations and run them to create the reviews table in your database. Publishing the config file lets you adjust table names and related settings to match your conventions. Keeping the default schema unless you have a specific reason to change it makes future upgrades simpler.
How do I upgrade from digikraaft/laravel-review-rating 3.1 to 3.2?
Upgrade the host application to Laravel 11 or 12 and PHP 8.2 first, then raise the Composer constraint to ^3.2 and run composer update for this package. Because 3.2.0 is primarily a platform-window and test-matrix change, there are no reported behavioral changes in the package itself. Verify the rest of your dependency graph also supports Laravel 12 before you bump, since conflicts usually surface through sibling packages.
Why did a minor release drop Laravel 10 support?
Version 3.2.0 moved the supported platform window to Laravel 11 and 12, following Laravel 10's end of security fixes rather than creating an earlier cutoff. Strictly speaking, removing framework support is a breaking change for consumers on that version, so treating it as a minor release is a governance caveat worth noting. In practice, pin Laravel 10 consumers to an explicit 3.1.* constraint so a routine composer update cannot strand them mid-sprint.
Is laravel-review-rating safe to use in production, and how should I test it?
It is a small, focused library rather than a service, so the integration risk sits in dependency management and your CI matrix rather than in application code. Add a test that creates a review, asserts the stored rating, and checks the computed average against your database. Also run your test suite against every Laravel and PHP version you actually deploy, since the package's own matrix only covers the versions it supports.
What are the alternatives to laravel-review-rating, and is it maintained?
Alternatives include rolling your own reviews table with a trait and average accessor, or using a broader ratings package from the Laravel ecosystem. This package's main advantages are a drop-in trait and a configurable schema, but it is a smaller project, so check the repository's recent commit activity and release history before adopting it. Pin an explicit version constraint and track the package's supported Laravel window as part of your upgrade planning.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core