PHPackages                             lucasbrito-wdt/laravel-rateable - 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. lucasbrito-wdt/laravel-rateable

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

lucasbrito-wdt/laravel-rateable
===============================

Allows multiple models to be rated with a fivestar like system.

043PHP

Since Jun 25Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Rateable
================

[](#laravel-rateable)

[![Latest Stable Version](https://camo.githubusercontent.com/6540a7e6e02e37e0916fb54f3045df5d96bc9c0e726fda2268e321a5532664c3/68747470733a2f2f706f7365722e707567782e6f72672f6c75636173627269746f2d7764742f6c61726176656c2d7261746561626c652f762f737461626c652e737667)](https://packagist.org/packages/lucasbrito-wdt/laravel-rateable) [![License](https://camo.githubusercontent.com/2a4f48920fcb5d85b1e17e6df4a3dfc6bf050874a4a48ed57914093df91d6f9a/68747470733a2f2f706f7365722e707567782e6f72672f6c75636173627269746f2d7764742f6c61726176656c2d7261746561626c652f6c6963656e73652e737667)](https://packagist.org/packages/lucasbrito-wdt/laravel-rateable)

[![Total Downloads](https://camo.githubusercontent.com/b6ed9490518cd9467dc43ee03520988538980088db32bce0c79041585f5a2787/68747470733a2f2f706f7365722e707567782e6f72672f6c75636173627269746f2d7764742f6c61726176656c2d7261746561626c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/lucasbrito-wdt/laravel-rateable) [![Monthly Downloads](https://camo.githubusercontent.com/d6956dd463d8e820d447784076d2758e197f19b42438e88f20b63431e5023ff9/68747470733a2f2f706f7365722e707567782e6f72672f6c75636173627269746f2d7764742f6c61726176656c2d7261746561626c652f642f6d6f6e74686c792e706e67)](https://packagist.org/packages/lucasbrito-wdt/laravel-rateable) [![Daily Downloads](https://camo.githubusercontent.com/93028d0e55b114eec9e3d0d1b37a5262a65c86dfc2f1f5a7b69ba4e52ade36be/68747470733a2f2f706f7365722e707567782e6f72672f6c75636173627269746f2d7764742f6c61726176656c2d7261746561626c652f642f6461696c792e706e67)](https://packagist.org/packages/lucasbrito-wdt/laravel-rateable)

Provides a trait to allow rating of any Eloquent models within your app for Laravel 6/7/8/9.

Ratings could be fivestar style, or simple +1/-1 style.

Compatability
-------------

[](#compatability)

Laravel versions &lt; 6.x should use the 1.x releases

Laravel versions &gt;= 6.x and &lt; 8.x should use 2.x+ releases

Laravel versions &gt;= 8.x should use the 3.x releases

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require lucasbrito-wdt/laravel-rateable
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="lucasbrito-wdt\Rateable\RateableServiceProvider" --tag="migrations"
php artisan migrate
```

As with most Laravel packages, if you're using Laravel 5.5 or later, the package will be auto-discovered ([learn more if this is new to you](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518)).

If you're using a version of Laravel before 5.5, you'll need to register the Rateable *service provider*. In your `config/app.php` add `'lucasbrito-wdt\Rateable\RateableServiceProvider'` to the end of the `$providers` array.

```
'providers' => [

    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...
    lucasbrito-wdt\Rateable\RateableServiceProvider::class,

],
```

Usage
-----

[](#usage)

In order to mark a model as "rateable", import the `Rateable` trait.

```
