trexology/reviewrateable
Rating syetem for Laravel 5
14,395
35
Larablocks Analysis
trexology/reviewrateable works with Laravel 5 (latest release 2.0.2, Jun 17, 2019), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Jun 17, 2019)
- 2 downloads a month (needs 10,000)
- 35 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Jun 17, 2019.
- No releases in the last 12 months.
- First released: Nov 11, 2015.
- Monthly downloads: 2.
- 9 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 4, 2026.
| Install | |
|---|---|
composer require trexology/reviewrateable |
|
| Latest Version: | 2.0.2 |
| PHP: | >=5.5.9 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Jun 17, 2019 |
| Links: | GitHub · Packagist |
Maintainer: trexology
Laravel ReviewRateable
ReviewRateable system for laravel 5.*
Installation
First, pull in the package through Composer.
composer require trexology/reviewrateable
And then include the service provider within app/config/app.php. (Skip this step if you are on Laravel 5.5 or above)
'providers' => [
Trexology\ReviewRateable\ReviewRateableServiceProvider::class
];
At last you need to publish and run the migration.
php artisan vendor:publish --provider="Trexology\ReviewRateable\ReviewRateableServiceProvider" && php artisan migrate
Setup a Model
<?php
namespace App;
use Trexology\ReviewRateable\Contracts\ReviewRateable;
use Trexology\ReviewRateable\Traits\ReviewRateable as ReviewRateableTrait;
use Illuminate\Database\Eloquent\Model;
class Post extends Model implements ReviewRateable
{
use ReviewRateableTrait;
}
Create a rating
$user = User::first();
$post = Post::first();
$rating = $post->rating([
'title' => 'Some title',
'body' => 'Some body', //optional
'anonymous' => 1, //optional
'rating' => 5,
], $user);
dd($rating);
Update a rating
$rating = $post->updateRating(1, [
'title' => 'new title',
'body' => 'new body', //optional
'anonymous' => 1, //optional
'rating' => 3,
]);
Delete a rating:
$post->deleteRating(1);
Fetch the average rating:
$post->averageRating()
or
$post->averageRating(2) //round to 2 decimal place
Count total rating:
$post->countRating()
Count rating meta (Count and Avg):
$post->ratingMeta()
or
$post->ratingMeta(2) //round to 2 decimal place
Fetch the rating percentage.
This is also how you enforce a maximum rating value.
$post->ratingPercent()
$post->ratingPercent(10)); // Ten star rating system
// Note: The value passed in is treated as the maximum allowed value.
// This defaults to 5 so it can be called without passing a value as well.
Alternatives to trexology/reviewrateable
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 2.0.2 | >=5.5.9 | ~5.0 | MIT | |
| 2.0.1 | >=5.5.9 | ~5.0 | MIT | |
| 2.0.0 | >=5.5.9 | ~5.0 | MIT | |
| 1.0.5 | >=5.5.9 | ~5.0 | MIT | |
| v1.0.4 | >=5.5.9 | ~5.0 | MIT | |
| v1.0.3 | >=5.5.9 | ~5.0 | MIT |