- What does nagy/laravel-rating do?
- It is a Laravel package that adds rating, like/dislike, and +1/-1 voting behavior to Eloquent models through a trait and a simple API. It supports multiple rating types and average scores, so you can attach scoring to users, posts, products, and similar models. It is a thin layer over Eloquent conventions rather than a full review or moderation platform.
- How do I install nagy/laravel-rating?
- Install it with composer require nagy/laravel-rating, then add the package trait to the model you want to rate. You typically add a rating column through a migration and call the exposed API to record or read scores. Because the last release is from 2021, check composer why-not against your Laravel and PHP versions before assuming it installs cleanly.
- Does nagy/laravel-rating support Laravel 10 or Laravel 11?
- Likely not out of the box. The last release was in 2021 and most likely pins illuminate/support to Laravel 8.x, so installation against Laravel 10, 11, or PHP 8.2+ may fail or be untested. Confirm the constraint with composer why-not and plan a fork or internal vendoring if you need a current major.
- How does nagy/laravel-rating store ratings?
- The package is described as a thin Eloquent trait plus column convention that persists scores into a column. That suggests an aggregate or denormalized value supporting a running average, but it is unclear whether it also keeps per-rater rows, deduplication, or audit history. Verify the persistence model before relying on it for moderation or 'who rated what' requirements.
- Is nagy/laravel-rating safe for concurrent rating writes?
- Not confirmed. With a column-based aggregate, two simultaneous ratings can cause lost updates unless the package uses atomic increments or transactions with locks. Inspect the write path and test concurrent requests before using it in a high-traffic production feature. If it is not concurrency-safe, wrap writes in your own transactional service.
- Can I rate multiple models and support polymorphic raters?
- The package attaches to any Eloquent model and supports multiple rating types, so rating multiple entity types is within scope. Polymorphic raters and one-rating-per-user constraints are the critical unknown and may not be supported if the package only maintains an aggregate counter. Test a one-user-one-rating scenario explicitly, and extend the schema yourself if needed.
- Does nagy/laravel-rating include migrations I can customize?
- The integration path expects you to add the rating column via migration, and it is unclear whether the package ships publishable migrations. Check the repository for migration files and confirm they run cleanly alongside your existing schema and can be rolled back. If migrations are not publishable, define the column yourself with your own naming and indexing conventions.
- What rating types and averages does nagy/laravel-rating provide?
- It supports ratings, likes and dislikes, and +1/-1 votes, with multiple rating types and averages. That makes it suitable for simple star scores or up/down signals on products, posts, and users. Confirm how averages are computed and whether they are recalculated or maintained incrementally, since that affects consistency.
- Is nagy/laravel-rating actively maintained?
- No. The last release was over four years ago, it has zero dependents, and it is a niche single-maintainer project with about 216 stars, so expect no upstream fixes. Treat it as internally owned: budget for a fork or a scheduled replacement, and record the decision in an ADR. MIT licensing makes forking or vendoring the small codebase viable.
- Should I use nagy/laravel-rating in production or build it myself?
- Use it only after a short spike proves compatibility and that the persistence model meets your requirements. The architectural surface is small enough that an in-house implementation is a credible alternative, especially if you need per-rater rows, audit history, or concurrency guarantees. If you adopt it, wrap it behind an internal RatingService interface so the dependency is swappable.