2017 © Pedro Peláez
 

package laravel-reviewable

Adds a reviewable feature to your app.

image

naoray/laravel-reviewable

Adds a reviewable feature to your app.

  • Saturday, March 24, 2018
  • by Naoray
  • Repository
  • 3 Watchers
  • 45 Stars
  • 76 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 12 Versions
  • 100 % Grown

The README.md

laravel-reviewable

Software License Travis StyleCI Total Downloads, (*1)

This package adds a reviewable feature to your app., (*2)

Install

Laravel Version 5.7+

composer require naoray/laravel-reviewable, (*3)

Laravel Version 5.6+

composer require naoray/laravel-reviewable:1.1.*, (*4)

Laravel Version 5.5

composer require naoray/laravel-reviewable:1.0.*, (*5)

publish config: php artisan vendor:publish --provider="Naoray\LaravelReviewable\LaravelReviewableServiceProvider", (*6)

Usage

First, add the Naoray\LaravelReviewable\Traits\HasReviews trait to your model you want to add reviews to., (*7)

use Naoray\LaravelReviewable\Traits\HasReviews;

class Post extends Model
{
    use HasReviews;

    // ...
}

Now you can create a review by:, (*8)

// from reviewable entity
Post::first()->createReview(5, 'Example review text', $author);

// author is assumed to be logged in and executing this operation
Post::first()->createReview(10);

// with helper
review($post, 5, 'Example Text', $author);

and receive review scores by:, (*9)

// summarizes all scores
Post::first()->score;

// gives the average of all scores
Post::first()->avg_score;

Using your own Review-Model

If you just want to change the global configuration to use your own Review-Model, just create a new Model and reference it in the reviewable.models.review config., (*10)

If you do not want to change the global review Model you can take a look at this issue for an example configuration., (*11)

Testing

Run the tests with:, (*12)

bash vendor/bin/phpunit, (*13)

Changelog

Please see CHANGELOG for more information what has changed recently., (*14)

Contributing

Please see CONTRIBUTING for details., (*15)

Security

If you discover any security-related issues, please email krishan.koenig@googlemail.com instead of using the issue tracker., (*16)

License

The MIT License (MIT). Please see License File for more information., (*17)

The Versions

24/03 2018

dev-master

9999999-dev

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

24/03 2018

dev-dev

dev-dev

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

13/03 2018

v1.0.4

1.0.4.0

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

13/03 2018

1.1.x-dev

1.1.9999999.9999999-dev

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

13/03 2018

1.0.x-dev

1.0.9999999.9999999-dev

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

13/03 2018

v1.0.5

1.0.5.0

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

13/03 2018

v1.1.2

1.1.2.0

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

26/02 2018

v1.1.1

1.1.1.0

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

26/02 2018

v1.0.3

1.0.3.0

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

21/02 2018

v1.0.2

1.0.2.0

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

20/02 2018

v1.1

1.1.0.0

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews

14/02 2018

v1.0.1

1.0.1.0

Adds a reviewable feature to your app.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Krishan Koenig

laravel rate reviews