F
Filament15mo ago
Shoxrux

Custom topbar (navbar) component to specific panel

I want to change topbar of the panel with my new custom component. If I add this new component to the folder with path: resources/views/vendor/filament-panels/components/topbar/, it works. However it updates all panels. What I really want is to update only in specific panel, not all. Is there any way to configure the panel, so that it would only update/take components from this path: /resources/views/filament/{panelId}/?
4 Replies
toeknee
toeknee15mo ago
Get the current panel id before applying your own one?
Shoxrux
ShoxruxOP15mo ago
No, I have panelId = customer, and I want to put my component inside resources/views/filament/customer/vendor/filament-panels/components/topbar and set customer panel to search components inside that folder
awcodes
awcodes15mo ago
you would have to create a whole custom layout yourself to make this work. the topbar is part of filaments view components, and overriding views in Laravel just doesn't work that way.
Shoxrux
ShoxruxOP15mo ago
Thank you, I created a custom layout as you said (copied original one), and updated to this: @if (filament()->getCurrentPanel()->getId() === 'customer') <x-filament-panels::topbar-custom :navigation="$navigation" /> @else <x-filament-panels::topbar :navigation="$navigation" /> @endif
Want results from more Discord servers?
Add your server