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(),
]);
}
Screenshot_2023-06-12_at_07.10.37.png
Was this page helpful?