Product Star-Based Rating with Custom Popup

Filament 3

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:

Only This Example

$9

One-time payment

Full source code for Product Star-Based Rating with Custom Popup
Downloadable ZIP file with the source code
Lifetime access to this example
GitHub Sign in with GitHub to buy

Sign in first, then complete your $9 checkout.

Best value — all 168 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 168 examples
Future new examples and updates included
FilaCheck Pro package licence included
MCP server included
View membership plans

30-day money-back guarantee

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.