Developer docs Core 2.2 · Pro 1.x

Search documentation

Search Core and Pro guides, including code examples.

CORE · FREE / MIT

Your first model.

Install the open-source review engine, connect a model, and build your own review experience.

← All Core topics

Model

Add the trait to a saved Eloquent model. The package uses a polymorphic review relationship, so products, posts, services, and bookings can share the same review engine.

namespace App\Models;

use Codebyray\ReviewRateable\Traits\ReviewRateable;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    use ReviewRateable;
}

Your application still owns the product model, authentication, authorization, routes, and front end. Do not submit reviews against an unsaved model. When using multiple databases, reviews, ratings, images, and compatible user tables must be available on the target model's connection.