beksos/reviewmaster
Laravel package to add user reviews and star/point ratings to any Eloquent model via a Reviewable trait. Supports configurable user model and a single admin reply per review (Google Play-style). Includes migrations, config publishing, and helper methods like makeReview().
reviews) with foreign keys to the reviewed model (e.g., product_id). Assess whether the package enforces migrations or expects manual setup.ReviewService), integration with business logic will be straightforward.deleted_at column) for reviews?with('reviews') on a high-traffic model)?laravel/framework).Schema::create('reviews', function (Blueprint $table) {
$table->id();
$table->foreignId('reviewable_id')->constrained()->onDelete('cascade');
$table->morphs('reviewable'); // For polymorphic relationships
$table->integer('rating');
$table->text('comment');
$table->foreignId('user_id')->constrained();
$table->timestamps();
});
reviewable models, rating scale).use Bekso\Reviewmaster\Facades\Review;
$reviews = Review::for(Product::find(1))->withComments()->get();
composer require beksos/reviewmaster:dev-main if needed.reviewer_name), extend via:
$table->string('reviewer_name')->nullable();
Review::cacheFor(60)).reviewable_id, user_id, created_at.N+1 issues with with() or load().public function getAverageRatingAttribute() {
return cache()->remember("product_{$this->id}_avg_rating", 3600, fn() => $this->reviews()->avg('rating'));
}
QueryException).How can I help you explore Laravel packages today?