Open source
Reviews for Laravel
composer require roundly-consulting/reviews-for-laravelOverview
A complete reviews and ratings system for Laravel. Any Eloquent model can write a review and any model can be reviewed — customers rate products, hosts rate guests, businesses rate users. It handles star ratings, a moderation lifecycle with pluggable auto-moderation, verified flags, helpful votes, owner responses, photo galleries, live or cached aggregates, events and first-class testing helpers — all behind one Reviews facade. MIT-licensed and native: its only dependencies are Laravel and three Roundly packages — media library, enums and package toolkit — installed automatically.
What you get
Anything reviews anything
Polymorphic author and subject — customers review products, hosts review guests, businesses review users.
Star ratings & aggregates
Configurable rating scale with live average, count, distribution and a RatingSummary DTO — or cached columns for hot pages.
Moderation lifecycle
Pending, approved and rejected with reasons, auto-approve, re-moderation on edit and a pluggable auto-moderator.
Review photos
A responsive photo gallery per review via Media Library for Laravel — public URLs or signed-only private photos.
Trust & engagement
Verified-purchase flags, helpful votes with most-helpful sorting, and owner responses that never touch the score.
Facade, DI or actions
Call the Reviews facade, inject ReviewsManager or run an action — the same code, with nine domain events, a JSON resource and macros.
Testing built in
A recording Reviews::fake() that still performs every operation, ten intent assertions, Pest matchers, a test-case trait and factories.
Documentation
Installation
Install via Composer, publish the publish-only migrations for reviews and media, and optionally the config, translations and resources.
Configuration
Every config key and its default — models, key type, rating scale, moderation, aggregates and review photos.
Database schema & key types
The reviews and review_votes tables, their columns and indexes, and how key_type supports UUID and ULID models.
Preparing your models
Add HasReviews to subjects, CanReview to authors and CanVoteOnReviews to voters — any model can play any role.
The Reviews facade
Every reviews operation on one facade — for($subject) handles, the swap-aware query(), and flat verbs for moderation, votes and verification.
DI and actions
Inject ReviewsManager instead of the facade, or run the action behind each verb — CreateReview, ApproveReview, VoteOnReview and more.
Creating reviews
Create reviews with the fluent facade — ratings, text, metadata, force-approve, verified flags — and know what gets validated.
Review photos
Attach photo galleries to reviews from uploads, drafts, disks or URLs, and render responsive images via Media Library.
Private photos & storage
Keep review photos off public storage — private disks, short-lived signed URLs and signed srcset for every reader.
Moderation lifecycle
Pending, approved and rejected statuses — approve and reject with reasons, build a moderation queue, use the status enum.
Auto-moderation
Screen new and edited reviews with the built-in banned-word moderator or your own ReviewModerator — approve, reject or leave pending.
Updating & deleting
Edit reviews with UpdateReviewData, re-moderate on edit, soft-delete, restore and force-delete.
Ratings & aggregates
Average rating, counts, star distribution and a RatingSummary DTO — live, approved-only aggregates on any subject.
Cached aggregates
Store reviews_count and reviews_avg on the subject’s table, keep them in sync automatically, rebuild with reviews:recount.
Querying reviews
Query scopes for status, rating, author, subject, verification, responses and helpfulness, plus authoring lookups.
Verified reviews
Flag verified purchases or reviewers on create, with Reviews::verify() or in an update, and filter verified and unverified reviews.
Helpful votes
Let any model vote reviews helpful or unhelpful — one vote per voter, flip on re-vote, denormalized tallies and sorting.
Owner responses
Reply publicly to a review — responses are threaded, approved immediately and never count toward ratings.
Events
Nine events — created, approved, rejected, updated, deleted, responded, voted, vote-removed and verified — react without touching the package.
JSON resource
ReviewResource and ReviewCollection expose a sensible public API shape — publish them to customise the fields.
Custom models & macros
Swap in your own Review or ReviewVote model, register custom facade verbs as macros, and control the facade alias.
Testing
Reviews::fake() records every mutation from any path while still performing it — ten assertions, Pest matchers, a test-case trait and factories.
Requirements
PHP 8.4+, Laravel 12 or 13, plus Roundly’s media library, enums and package toolkit — installed automatically.
Show your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.