PHPackages                             mtvs/laravel-reviews - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mtvs/laravel-reviews

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mtvs/laravel-reviews
====================

Reviews and ratings for the Laravel Framework

v2.2.0(3y ago)323804MITPHP

Since Jul 30Pushed 3y ago3 watchersCompare

[ Source](https://github.com/mtvs/laravel-reviews)[ Packagist](https://packagist.org/packages/mtvs/laravel-reviews)[ RSS](/packages/mtvs-laravel-reviews/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (8)Used By (0)

[![Build Status](https://github.com/mtvs/laravel-reviews/actions/workflows/build.yml/badge.svg)](https://github.com/mtvs/laravel-reviews/actions/workflows/build.yml/badge.svg)

Laravel Reviews
===============

[](#laravel-reviews)

### Ratings and reviews for the Laravel's Eloquent models

[](#ratings-and-reviews-for-the-laravels-eloquent-models)

[![laravel-reviews](https://user-images.githubusercontent.com/8286154/180592946-5d5d99ef-9e06-489a-9de9-b7a5184a6637.gif)](https://user-images.githubusercontent.com/8286154/180592946-5d5d99ef-9e06-489a-9de9-b7a5184a6637.gif)

Users will be able to rate and review the reviewable models. Then these reviews can be approved and be shown.

You will be able to load the ratings average and count on a reviewable model and display them.

It will provide the ability to sort the reviewables based on their ratings average using the Bayesian formula.

Installation And Setup
----------------------

[](#installation-and-setup)

```
composer require mtvs/laravel-reviews
```

Then publish the files that are supposed to be in your codebase in order to be customizable by you. They're the review model, its database migration, its database factory, the HTTP controller and the config file.

```
php artisan vendor:publish
```

Next in your routes file, call the following macro on the router to register the default routes. You can use `artisan route:list` to see the routes.

```
Route::reviews();
```

Then, if you want to use the UI components, run the following command to install them. The components are written using Vue and Bootstrap.

The command also installs a stylesheet and a pack of font icons in the public directory to be used by the components. Don't forget to include the stylesheet in your views layout file.

```
php artisan reviews:ui
```

If you haven't enabled the auto registration in the `app.js` file, you need to register the components manually.

```
Vue.component('reviews', require('./components/reviews/Reviews.vue').default);
Vue.component('reviews-current', require('./components/reviews/ReviewsCurrent.vue').default);
Vue.component('reviews-form', require('./components/reviews/ReviewsForm.vue').default);
Vue.component('reviews-list', require('./components/reviews/ReviewsList.vue').default);
Vue.component('reviews-pagination', require('./components/reviews/ReviewsPagination.vue').default);
Vue.component('reviews-single', require('./components/reviews/ReviewsSingle.vue').default);
Vue.component('reviews-stars', require('./components/reviews/ReviewsStars.vue').default);

Vue.component('approval-status', require('./components/approval/ApprovalStatus.vue').default);
Vue.component('approval-buttons', require('./components/approval/ApprovalButtons.vue').default);
```

Now let's setup the models. There are some traits that are meant to be imported in the review model, the user model and also the model(s) that are going to be reviewed. The review model's trait has already been imported in it when it was installed. But the other traits need to be installed manually.

```
namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Mtvs\Reviews\PerformsReviews;

class User extends Authenticatable
{
	use PerformsReviews;
}
```

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Mtvs\Reviews\Reviewable;

class Product extends Model
{
    use Reviewable;
}
```

You also have to specify the reviewable models in the reviews config file.

```
'reviewables' => [
	\App\Models\Product::class,
],
```

Finally, remember to run the database migrations and compile the view components. You can also use the provided factory to seed the reviews.

Usage
-----

[](#usage)

### The Ratings Component

[](#the-ratings-component)

To display the average and the count of a reviewable model's ratings, you can call ``.

```

```

Do not forget to load those values on the model by calling `loadRatings()` on it or eager load them when making the query by calling `withRatings()`.

### The Reviews Component

[](#the-reviews-component)

To display the list of the reviews of a reviewable model and also the form to post them, you can call ``.

```

```

It also contains a call to the ``.

You can link the ratings component that you possibly use in the upper part of the page to the reviews component by wrapping the ratings in an `` referring the reviews component.

### Ranking Based on The Ratings

[](#ranking-based-on-the-ratings)

Reviewable models can be sorted based on their ratings when they're queried. To do so call the `highestRated()` on the query. It uses the Bayesian average formula to calculate the score of each model and sort them from the highest to the lowest score.

### The Approval of Reviews

[](#the-approval-of-reviews)

The review model uses `Approvable` trait from [mtvs/eloquent-approval](https://github.com/mtvs/eloquent-approval) to enable to manage which reviews are allowed to be displayed.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~37 days

Total

7

Last Release

1235d ago

Major Versions

v1.0.2 → v2.0.02022-12-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/f02aa2b87486bfd83077bcc587ccc5891ddf49d1dfe834e2ac749d81537b2cce?d=identicon)[mtvs](/maintainers/mtvs)

---

Top Contributors

[![mtvs](https://avatars.githubusercontent.com/u/8286154?v=4)](https://github.com/mtvs "mtvs (137 commits)")

---

Tags

laravelratingreviews

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mtvs-laravel-reviews/health.svg)

```
[![Health](https://phpackages.com/badges/mtvs-laravel-reviews/health.svg)](https://phpackages.com/packages/mtvs-laravel-reviews)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4205.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
