LaravelPackages.net
Acme Inc.
Toggle sidebar
craigzearfoss/user-ratings

Add user ratings to Laravel 5.1 Eloquent models.

97
2
About craigzearfoss/user-ratings

craigzearfoss/user-ratings is a Laravel package for add user ratings to laravel 5.1 eloquent models.. It currently has 2 GitHub stars and 97 downloads on Packagist. Install it with composer require craigzearfoss/user-ratings. Discover more Laravel packages by craigzearfoss or browse all Laravel packages to compare alternatives.

Last updated

User Ratings for Laravel 5

This package allows you to attach user ratings an Eloquent model in Laravel 5. The ratings include an integer field for a numeric rating; boolean fields for like, dislike and favorite and a text field for a comment.

Composer Install

It can be found on Packagist. The recommended way is through composer.

Edit composer.json and add:

{
    "require": {
        "craigzearfoss/user-ratings": "dev-master"
    }
}

And install dependencies:

$ composer update

If you do not have Composer installed, run these two commands:

$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install

Install and then Run the migrations

Find the providers array key in config/app.php and register the User Ratings Service Provider.

'providers' => array(
    // ...

    Craigzearfoss\UserRatings\UserRatingsServiceProvider::class,
)

Run the migration to create the user_ratings table.

php artisan vendor:publish --provider="Craigzearfoss\UserRatings\Providers\UserRatingsServiceProvider"
php artisan migrate

Configuration

In your model add the UserRatableTrait.

<?php

// ...
use Craigzearfoss\UserRatings\UserRatableTrait;

class MyModel extends Model
{
    use UserRatableTrait;

Usage

@TODO

Changelog

See the CHANGELOG file

Support

Please open an issue on GitHub

Contributor Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

UserRatings is released under the MIT License. See the bundled LICENSE file for details.

Star History Chart