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 Rateable

Laravel Rateable Laravel Package

willvincent/laravel-rateable

Add likes, dislikes, upvotes, and ratings to any Laravel Eloquent model with a simple trait. The package stores votes and ratings in a polymorphic table and provides intuitive methods and scopes for querying, counting, and averaging results.

View on GitHub
Deep Wiki
Context7

Allows multiple models to be rated with a fivestar like system.

Frequently asked questions about Laravel Rateable
What is willvincent/laravel-rateable and what does it do?
willvincent/laravel-rateable is a Laravel package that adds a five-star style rating system to Eloquent models. It lets multiple model types be rated through a polymorphic votes table and provides methods and scopes for querying, counting, and averaging results. It is commonly used for likes, dislikes, upvotes, and star ratings.
How do I install willvincent/laravel-rateable in a Laravel application?
Install it with Composer using composer require willvincent/laravel-rateable, then follow the package README to publish and run its migrations. Add the Rateable trait to each Eloquent model that should receive votes or ratings. Because Laravel package discovery usually handles service providers, verify the documented setup steps for your Laravel version before deploying.
Does willvincent/laravel-rateable support Laravel 12?
Release 3.5.0 of willvincent/laravel-rateable notes Laravel 12 support, so it is intended to work with the current Laravel ecosystem. You should still check composer.json for exact PHP and Laravel constraints and confirm whether older Laravel versions remain supported. Run your application test suite in a branch before upgrading production.
How do I make an Eloquent model rateable with this package?
Add the package's Rateable trait to your Eloquent model and ensure the package migrations have created the polymorphic votes table. The model can then use the package's rating and voting methods, and queries can use its scopes. Consult the README for the exact method names and expected argument formats.
Can I rate multiple different models with willvincent/laravel-rateable?
Yes. The polymorphic table design is specifically intended to let multiple model types be rated by the same package. You add the Rateable trait to each model you want to rate and query results per model type. This avoids creating separate rating tables for posts, comments, users, or other entities.
How do I get average ratings and vote counts in Laravel with this package?
The package provides intuitive methods and scopes for counting votes and averaging ratings on rateable models. You can use these from your controllers, views, or query builders to display scores and sort by rating. Check the README for the exact scope and aggregate method names in your installed version.
Does willvincent/laravel-rateable support likes, dislikes, and upvotes as well as five-star ratings?
The package overview describes a five-star like system and also mentions likes, dislikes, and upvotes. That suggests you can model simple vote interactions as well as numeric star ratings, depending on how you call the rating methods. Confirm the supported value conventions in the package documentation before choosing your schema and UI.
How should I test willvincent/laravel-rateable in my Laravel app?
Write feature tests that attach the Rateable trait to a test model, create votes from different users, and assert counts and averages. Use Laravel's database testing tools with the package migrations loaded, and cover duplicate-vote and update-vote scenarios if your application relies on them. Also test the scopes you use for sorting or filtering rated models.
Is willvincent/laravel-rateable production-ready and well maintained?
The package is Laravel-native and the 3.5.0 release signals Laravel 12 compatibility, but the TPM assessment flags ambiguity around exact constraints, CI coverage, and support policy. Before production use, verify composer.json, the changelog, test coverage, and maintainer responsiveness. Pin a known-good version and run regression tests around your rating flows.
What are alternatives to willvincent/laravel-rateable for Laravel ratings?
Alternatives depend on whether you need simple likes or full five-star ratings; common Laravel options include dedicated like and vote packages and custom polymorphic vote tables. willvincent/laravel-rateable is a reasonable fit if you want one trait and a polymorphic ratings table across multiple models. Compare maintenance activity, Laravel 12 support, and API ergonomics before choosing.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
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