Can I use Form layouts like FieldSet with table filter ?
Can I use Form layouts like FieldSet with table filter ?
12 Replies
Can you elaborate? Inside a filter? Should be possible. Any issues?
I need like this in filter
Yeah. And where are you stuck? Anything not working?
This picture is form not filter, I want to make the same layout in table filter
I have a lot of field in filter and I want to organize them like in the picture
Yes. And it should be possible. Did you try it?
Check the docs on filter forms
public static function table(Table $table): Table
{
return $table
->columns(Transaction::getTableColumns())
->filters([
Fieldset::make('hi')->schema([
Filter::make('id')->translateLabel()
->form([
TextInput::make('id'),
])->query(function (Builder $query, array $data): Builder {
if (optional($data)['id']) {
return $query->where('id', $data['id']);
} else {
return $query;
}
}),
]),
]);
}
This is the filter I used in the resource
I got this error when I use FieldSet within table filter
I've checked the docs and I did not found anything talking about that
Try putting the
Fieldset
inside the ->form([
Something like this maybe?
Ok, I will try
Not sure how do didn’t find this. I even gave you the exact keywords.
https://filamentphp.com/docs/2.x/tables/filters#filter-forms
Filament
Filters - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
Also please read the #✅┊rules especially the part about code formatting