Black Friday: coupon FRIDAY24 for 40% off Yearly/Lifetime membership! Read more here

Product Star-Based Rating with Custom Popup

Ratings help your product collect information on how well things are received by users. And it is completely possible to build a rating system into the table!

FilamentExamples ThumbBase (40)

Get the Source Code:

How it works

We have a Product model, which we show in the table, and a Review model, where we save the star rating and review comments.

We use the mokhosh/filament-rating Filament plugin to add a star rating.

The table can be found in ProductResource. First, to show the number of reviews, we modify the query to load the number of reviews relationships. Then, we add another select to get users' ratings for the product.

app/Filament/Resources/ProductResource.php:

use Illuminate\Database\Eloquent\Builder;
 
public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(function (Builder $query) {
return $query->withCount('reviews')
// ...
The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.
Get the Source Code: All 64 Premium Examples for $99