Grouping relation managers in a nested tab

I have around 12 relation managers for a resource. I am trying to group relation managers in a tab. But i cant find a way to show the group relation managers in nested tab instead of rendering them on top of each other. Trying to group relations using: https://filamentphp.com/docs/3.x/panels/resources/relation-managers#grouping-relation-managers
6 Replies
LeandroFerreira
LeandroFerreira•2w ago
Relation managers are Livewire components.. maybe this can help you https://x.com/leandrocfe/status/1864854632272420864
Leandro Ferreira (@leandrocfe) on X
💡Filament Tip: You can insert Livewire components into a form, which allows us to use this approach to insert Relation Managers into Form Tabs. In this example, we added Categories and Comments (both Relation Managers) into Form Tabs 👇
From An unknown user
Twitter
Mansoor Khan
Mansoor KhanOP•2w ago
Thats a great idea. I follow you on x and love your tips 🙂 for this to work. i would need to render a custom class in place of the relation manager so that it renders a form or a view that has the nested tabs containing all other relationships. is it possible to pass a custom class in place of the relation manager?
LeandroFerreira
LeandroFerreira•2w ago
you can pass Livewire Components
Mansoor Khan
Mansoor KhanOP•2w ago
yes exactly a Livewire component but how. any example please?
Mansoor Khan
Mansoor KhanOP•2w ago
That i understand. I am sorry i am not clear enough I have following code and i need the grouped relations to move under the Scoped tab and appear as nested tabbed relations. Instead of rendering all the relations on top of each other. I need a nested-tab (see red box in image). Now this can be achieved as you said using tabs in a form. But to render a form I will need to pass the custom Livewire component that renders the nested tabs. so i am looking for a way to pass the custom Livewire component, so when scope tab is active it renders the custom Livewire component which then renders the nested-tab.
public static function getRelations(): array
{
return [
RelationManagers\SomeRelationManager::class,
...
RelationGroup::make('Scope', [
RelationManagers\ExampleRelationManager::class,
RelationManagers\AnotherExampleRelationManager::class,
]),
];
}
public static function getRelations(): array
{
return [
RelationManagers\SomeRelationManager::class,
...
RelationGroup::make('Scope', [
RelationManagers\ExampleRelationManager::class,
RelationManagers\AnotherExampleRelationManager::class,
]),
];
}
No description
Want results from more Discord servers?
Add your server