Package Data | |
---|---|
Maintainer Username: | craigzearfoss |
Maintainer Contact: | craigzearfoss@yahoo.com (Craig Zearfoss) |
Package Create Date: | 2016-04-26 |
Package Last Update: | 2017-01-15 |
Language: | PHP |
License: | MIT License |
Last Refreshed: | 2024-12-11 15:13:42 |
Package Statistics | |
---|---|
Total Downloads: | 97 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
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.
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
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
In your model add the UserRatableTrait.
<?php
// ...
use Craigzearfoss\UserRatings\UserRatableTrait;
class MyModel extends Model
{
use UserRatableTrait;
@TODO
Please open an issue on GitHub
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.
UserRatings is released under the MIT License. See the bundled LICENSE file for details.