Search by

roundly-consulting / reviews-for-laravel

mihaliak

Write reviews to any entity from any entity.

Package info

github.com/roundly-consulting/reviews-for-laravel

pkg:composer/roundly-consulting/reviews-for-laravel

Fund package maintenance!

Patreon

Statistics

Installs: 16

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-10-03 18:10 UTC

This package is auto-updated.

Last update: 2026-10-03 18:32:13 UTC


README

Reviews for Laravel — Roundly open source

Latest release Tests Code style Donate Patreon Crypto

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.

Donate to Roundly open source Become a patron on Patreon Donate crypto: BTC, ETH, BNB or SOL

License

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