32 lines
1.1 KiB
PHP
32 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\BazaarReviews\Tables;
|
|
|
|
use Filament\Actions\ViewAction;
|
|
use Filament\Tables\Columns\IconColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Filters\SelectFilter;
|
|
use Filament\Tables\Table;
|
|
|
|
class BazaarReviewsTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('rate')->badge()->sortable(),
|
|
TextColumn::make('text')->limit(70)->searchable()->wrap(),
|
|
TextColumn::make('app_version_code')->label('App version')->sortable(),
|
|
IconColumn::make('replied')->label('Replied')->state(fn ($record): bool => filled($record->developer_reply_text))->boolean(),
|
|
TextColumn::make('published_at')->dateTime()->sortable(),
|
|
])
|
|
->filters([
|
|
SelectFilter::make('rate')->options([1 => '1 star', 2 => '2 stars', 3 => '3 stars', 4 => '4 stars', 5 => '5 stars']),
|
|
])
|
|
->recordActions([
|
|
ViewAction::make(),
|
|
])
|
|
->defaultSort('published_at', 'desc');
|
|
}
|
|
}
|