@@ -98,18 +98,18 @@ return [
9898
9999## Usage
100100### Making a Model Reviewable
101- To allow a model to be reviewed, add the `` ReviewRatable `` trait to your model. For example, in your `` Product `` model:
101+ To allow a model to be reviewed, add the `` ReviewRateable `` trait to your model. For example, in your `` Product `` model:
102102``` php
103103<?php
104104
105105namespace App\Models;
106106
107107use Illuminate\Database\Eloquent\Model;
108- use CodeByRay\LaravelReviewRatable \Traits\ReviewRatable ;
108+ use Codebyray\ReviewRateable \Traits\ReviewRateable ;
109109
110110class Product extends Model
111111{
112- use ReviewRatable ;
112+ use ReviewRateable ;
113113}
114114```
115115### Adding a Review
@@ -119,14 +119,14 @@ $product = Product::find(1);
119119
120120$product->addReview([
121121 'review' => 'Great product! The quality is superb and customer service was excellent.',
122- 'department' => 'sales', // Optional, defaults to 'default'
123- 'recommend' => true, // Whether the user would recommend the product being reviewed
124- 'approved' => true, // Optionally override default approval (false) by providing 'approved'
122+ 'department' => 'sales', // Optional, defaults to 'default'
123+ 'recommend' => true, // Whether the user would recommend the product being reviewed
124+ 'approved' => true, // Optionally override default (false) approval by providing 'approved'
125125 'ratings' => [
126- 'overall' => 'Overall Rating' ,
127- 'communication' => 'Communication Rating' ,
128- 'follow_up' => 'Follow-Up Rating' ,
129- 'price' => 'Price Rating' ,
126+ 'overall' => 5 ,
127+ 'communication' => 5 ,
128+ 'follow_up' => 5 ,
129+ 'price' => 5 ,
130130 ],
131131], auth()->id());
132132```
0 commit comments