Customise navigationGroup->icon from Plugin?
Hello, first time poster. New to Laravel and Filament but not a complete newbie to programming/php.
What I'm trying to do:
I am creating a plugin, and it will come with Resources. I can obviously set
?string $navigationGroup
on the Resource, but per https://filamentphp.com/docs/3.x/panels/navigation#customizing-navigation-groups you have to set the icon in the panel settings.
What I would like to do:
Set the navigation group icon within the Plugin package, so that it doesn't need to be manually added (or added by an installcommand).
What I have tried:
I've tried searching the web, this discord, the documentation, I even chanced asking AI (so we know I was clutching at straws) and the only reference I can see is that it has to be set on the panel instantiation in the PanelProvider. I'm hoping I am just too new to the ecosystem to know of the obvious way to do this and that's why it's not stated anywhere, but if it's not possible that's fine too.8 Replies
Since you have resources you should just be able to set them there.
Thanks for replying! Within the Resource I can set $navigationIcon and $navigationGroup ... but there doesn't seem to be any string defined for the group icon?
ahh. you'll need to use the plugin object then to do the custom navigation setup then.
Great, I figured that's where I would need to be, however this is where my relative inexperience is showing and I'm not sure how, and my searching attempts have been unsuccessful in finding any examples. If you (or anyone else) can give any pointers I'd really appreciate it
And my apologies if this is something I should just know by now, I am self-taught and doing my best π
for example, in the plugin object you can do this:
i'm self taught too, no worries.
Oh it's that simple? Awesome I will go have a fiddle
Solution
Solution: