Product Star-Based Rating Column with Custom Popup

Filament 4/5

Ratings let you gather user feedback on how well your product is received. You can easily integrate a rating system directly into your Filament tables!

FilamentExamples ThumbBase (11)

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for Product Star-Based Rating Column 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/Products/Tables/ProductsTable.php:

use App\Models\Review;
use App\Models\Product;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Builder;
use Filament\Tables\Table;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Columns\ViewColumn;
 
public static function configure(Table $table): Table
{
return $table
->modifyQueryUsing(function (Builder $query) {
return $query->withCount('reviews')
// ...

Next, we will:

  • Create a custom Table Column
  • Add Action to that column
The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.