Looking to hire Laravel developers? Try LaraJobs

reviews-for-laravel maintained by roundly-consulting

Description
Write reviews to any entity from any entity.
Last update
2026/10/03 20:10 (dev-main)
License
Downloads
16

Comments
comments powered by Disqus

Reviews for Laravel

Ratings and reviews for any Eloquent model — users review products, businesses review users, anything can review anything. Star ratings, a moderation lifecycle, verified purchases, helpful votes, owner responses, review photos and cached aggregates, behind one fluent facade.

Installation

Requires PHP 8.4 and Laravel 12 or 13.

composer require roundly-consulting/reviews-for-laravel
php artisan vendor:publish --tag="reviews-migrations"
php artisan vendor:publish --tag="media-migrations"   # review photos live in media-library
php artisan migrate

If the models being reviewed, writing reviews or voting have UUID/ULID keys, set REVIEWS_KEY_TYPE=uuid (or ulid) before migrating.

Usage

Make a model reviewable and another one a reviewer:

use RoundlyConsulting\Reviews\Concerns\CanReview;
use RoundlyConsulting\Reviews\Concerns\HasReviews;

class Product extends Model
{
    use HasReviews;
}

class User extends Authenticatable
{
    use CanReview;
}

Then write, moderate and read reviews:

use RoundlyConsulting\Reviews\Facades\Reviews;

$review = Reviews::for($product)->by($user)
    ->rating(5)
    ->title('Loved it')
    ->content('Great value for the price')
    ->verified()                                    // a verified purchase
    ->create();                                     // lands as pending

Reviews::approve($review);
Reviews::respond($review, $owner, 'Thanks for the feedback!');
Reviews::vote($review, $shopper, helpful: true);

Reviews::for($product)->average();                  // 5.0
Reviews::for($product)->distribution();             // [5 => 1]
Reviews::for($product)->query()->approved()->mostHelpful()->paginate();

Documentation

The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/reviews-for-laravel

Release notes are in CHANGELOG.md. To contribute, see the contributing guide.

Support our work

This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.

License

The MIT License (MIT). Please see License File for more information.