F
Filament17mo ago
Sesh

Arranging records into a grid does not work

I just tried to arrange my table content into a grid as described here: https://filamentphp.com/docs/3.x/tables/layout#arranging-records-into-a-grid. But it does not work (content is still in the table form). Am I missing something or is the functionality not yet implemented in v3? Here is my code:
return $table
->query(Study::query())
->columns([
TextColumn::make('access')
->badge()
->label(__('Access'))
->colors([
'primary'
])
->sortable(),
TextColumn::make('date')
->label(__('Date'))
->date()
->extraAttributes(['class' => 'text-sm mt-2'])
->sortable(),
TextColumn::make('title')
->label(__('Title'))
->extraAttributes(['class' => 'text-xl font-bold mt-1'])
->searchable()
->sortable(),
])
->defaultSort('date', 'desc')
->persistSortInSession()
->filters([
// ...
])
->persistFiltersInSession()
->actions([
// ...
])
->bulkActions([
// ...
])
->paginated([12, 24, 48, 96, 'all'])
->recordUrl(
fn (Model $record): string => route('studies.show', $record->id)
)
->contentGrid([
'md' => 2,
'xl' => 3,
]);
return $table
->query(Study::query())
->columns([
TextColumn::make('access')
->badge()
->label(__('Access'))
->colors([
'primary'
])
->sortable(),
TextColumn::make('date')
->label(__('Date'))
->date()
->extraAttributes(['class' => 'text-sm mt-2'])
->sortable(),
TextColumn::make('title')
->label(__('Title'))
->extraAttributes(['class' => 'text-xl font-bold mt-1'])
->searchable()
->sortable(),
])
->defaultSort('date', 'desc')
->persistSortInSession()
->filters([
// ...
])
->persistFiltersInSession()
->actions([
// ...
])
->bulkActions([
// ...
])
->paginated([12, 24, 48, 96, 'all'])
->recordUrl(
fn (Model $record): string => route('studies.show', $record->id)
)
->contentGrid([
'md' => 2,
'xl' => 3,
]);
6 Replies
Ilham Dimas Prayudha
Try add Split::make([]) to wrap around columns
Sesh
SeshOP16mo ago
stack
Sarah
Sarah16mo ago
Did you get this to work?
Sesh
SeshOP16mo ago
Yes you need Split or Stack, otherwise it will not arrange it as cards properly.
Want results from more Discord servers?
Add your server