Hide group when sharing a resource's table with a relation manager

Is it possible to hide one of the grouping options or all of them in case of reusing the resource in a relation manager?
3 Replies
Patrick Boivin
I think something like this should work
->hidden(fn ($livewire) => $livewire instanceof MyRelationManager)
->hidden(fn ($livewire) => $livewire instanceof MyRelationManager)
H.Bilbao
H.BilbaoOP2y ago
Thanks but hidden does not exist: Method Filament\Tables\Grouping\Group::hidden does not exist.
->groups([
Group::make('edition.name')
->collapsible()
->hidden(fn ($livewire) => $livewire instanceof StagesRelationManager),
])
->groups([
Group::make('edition.name')
->collapsible()
->hidden(fn ($livewire) => $livewire instanceof StagesRelationManager),
])
Patrick Boivin
Ok, I didn't know that. I'm not sure there's an easy way to hide a specific group then. If you're reusing a static method from the resource in the relation manager, maybe you could pass a parameter to the method to configure the table grouping?

Did you find this page helpful?