Download the PHP package gorankrgovic/laravel-reviewable without Composer
On this page you can find all versions of the php package gorankrgovic/laravel-reviewable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gorankrgovic/laravel-reviewable
More information about gorankrgovic/laravel-reviewable
Files in gorankrgovic/laravel-reviewable
Package laravel-reviewable
Short Description Make Laravel Eloquent models Reviewable using UUIDs.
License MIT
Homepage https://github.com/gorankrgovic/laravel-reviewable
Informations about the package laravel-reviewable
Laravel Reviewable (5 Star rating and review)
Introduction
This package ads the ability for your mdeosl to be reviewable. Basically to add a review system to your application.
Also, worth noting that this package utilizes usage of UUID's instead of integer ID's. And the "Likeable" and "Liker" models needs to utilize UUIDs as well. If you are not using UUID's please be my guest and fork the package to made a non-uuid version.
For the UUID generation this package uses Ramsey UUID.
Features
- Uses UUIDs instead of integers (your user model must use them as well!)
- Designed to work with Laravel Eloquent models.
- Using contracts to keep high customization capabilities.
- Using traits to get functionality out of the box.
- Most part of the the logic is handled by the
ReviewableService
. - Subscribes for one model are mutually exclusive.
- Get Reviewable models ordered by reviews count.
- Get Reviewable models ordered by reviews average rating.
- Events for
review
,unreview
methods. - Following PHP Standard Recommendations:
Installation
First, pull in the package through Composer.
Perform Database Migration
At last you need to publish and run database migrations.
If you want to make changes in migrations, publish them to your application first.
Usage
Prepare Reviewer Model
Use Gox\Contracts\Reviewable\Reviewer\Models\Reviewer
contract in model which will get likes
behavior and implement it or just use Gox\Laravel\Reviewable\Reviewer\Models\Traits\Reviewer
trait.
Prepare Reviewable Model
Use Gox\Contracts\Reviewable\Reviewable\Models\Reviewable
contract in model which will get likes
behavior and implement it or just use Gox\Laravel\Reviewable\Revieable\Models\Traits\Reviewable
trait.
Available Methods
Reviews
Review model
Remove review mark from model
Get model reviews count
Get model reviews avg
Get model reviews counter
Get reviews relation
Boolean check if user reviewed model
Delete all reviews for model
Scopes
Find all articles reviewed by user
Fetch Reviewable models by reviews count
Uses desc
as default order direction.
Events
On each like added \Gox\Laravel\Reviewable\Reviewable\Events\ReviewableWasReviewed
event is fired.
On each like removed \Gox\Laravel\Reviewable\Reviewable\Events\ReviewableWasUnreviewed
event is fired.
Security
If you discover any security related issues, please email me instead of using the issue tracker.
License
Laravel Reviewable
package is open-sourced software licensed under the MIT license by Goran Krgovic.
All versions of laravel-reviewable with dependencies
illuminate/database Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0
illuminate/support Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0
ramsey/uuid Version ^3.8