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

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

devfelipereis/laravel-rateable
==============================

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

1.0.3(10y ago)024MITPHPPHP &gt;=5.4

Since Aug 27Pushed 9y ago2 watchersCompare

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

READMEChangelogDependencies (3)Versions (5)Used By (0)

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

[](#laravel-rateable)

[![Build Status](https://camo.githubusercontent.com/3aee4018f9693cab9f0e22d5791fafea631bedb7179d7d7d02c67f6bcb16f51e/68747470733a2f2f7472617669732d63692e6f72672f77696c6c76696e63656e742f6c61726176656c2d7261746561626c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/willvincent/laravel-rateable)[![Latest Stable Version](https://camo.githubusercontent.com/dc70afade43a75039b69dad022e39f3fa151a8e03213d52dc51c07641638a350/68747470733a2f2f706f7365722e707567782e6f72672f77696c6c76696e63656e742f6c61726176656c2d7261746561626c652f762f737461626c652e737667)](https://packagist.org/packages/willvincent/laravel-rateable) [![License](https://camo.githubusercontent.com/08a1455777273114aff249b4d96cc81fcc1adbaaa6aa3f46336055045d6f93bc/68747470733a2f2f706f7365722e707567782e6f72672f77696c6c76696e63656e742f6c61726176656c2d7261746561626c652f6c6963656e73652e737667)](https://packagist.org/packages/willvincent/laravel-rateable)

[![Total Downloads](https://camo.githubusercontent.com/f0164160e58ebcd9c2b2ca42d0d6c9b167f462906b9fc3b58b8182f217c0ffc9/68747470733a2f2f706f7365722e707567782e6f72672f77696c6c76696e63656e742f6c61726176656c2d7261746561626c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/willvincent/laravel-rateable) [![Monthly Downloads](https://camo.githubusercontent.com/950099de28209d45de75110cd069e0d709d86d19db71e0c680589d052cf837e5/68747470733a2f2f706f7365722e707567782e6f72672f77696c6c76696e63656e742f6c61726176656c2d7261746561626c652f642f6d6f6e74686c792e706e67)](https://packagist.org/packages/willvincent/laravel-rateable) [![Daily Downloads](https://camo.githubusercontent.com/d00d084e9aecd23bce75932bc748d3b2a41d3b7cd0a7ee8fd7e051ef223e70b6/68747470733a2f2f706f7365722e707567782e6f72672f77696c6c76696e63656e742f6c61726176656c2d7261746561626c652f642f6461696c792e706e67)](https://packagist.org/packages/willvincent/laravel-rateable)

FOR PERSONAL USE. DON'T USE THIS FORK. USE:

Provides a trait to allow rating of multiple models within your app for Laravel 5.

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

Installation
============

[](#installation)

Edit your project's composer.json file to require `willvincent/laravel-rateable`.

```
"require": {
  "willvincent/laravel-rateable": "~1.0"
}

```

Next, update Composer from the terminal.

```
composer update

```

As with most Laravel packages you'll need to register Rateable *service provider*. In your `config/app.php` add `'willvincent\Rateable\RateableServiceProvider'` to the end of the `$providers` array.

```
'providers' => [

    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...
    willvincent\Rateable\RateableServiceProvider::class,

],
```

Getting started
===============

[](#getting-started)

After the package is correctly installed, you need to generate the migration.

```
php artisan rateable:migration

```

It will generate the `_create_ratings_table.php` migration. You may now run it with the artisan migrate command:

```
php artisan migrate

```

After the migration, one new table will be present, `ratings`.

Usage
=====

[](#usage)

You need to set on your model that it is rateable.

```
