Clickable grid layout table
Each of these are clickable, but routes to edit.
I checked the docs but somehow I'm not able to route to desired location. I want to route it to the same location as i have set the route for the name.
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->url(fn ($record): string => route(
'filament.resources.stocks.index',
['stock_category_id' => $record->id]
))->searchable()
->openUrlInNewTab(),
Tables\Columns\TextColumn::make('stocks_count')
->label('Stocks')
->color(fn ($record): string => $record->stocks_count < 10 ? 'danger' : 'gray')
->counts('stocks')
->formatStateUsing(fn ($record): string => "$record->stocks_count items"),
])
->contentGrid([
'md' => 4
])
->defaultSort('name')
->filters([])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
// Tables\Actions\DeleteBulkAction::make(),
]);
}
1 Reply
I believe clickable rows method still applies;
https://filamentphp.com/docs/2.x/tables/getting-started#clickable-rows
Filament
Getting started - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.