F
Filament9mo ago
Dimmm

How can i publish view component that comes from filament ?

Some views that i wanted to customize such as login view, or topbar layout is only available in the vendor folder. But i cant seem to find the command to publish those views on the internet.
5 Replies
Dennis Koch
Dennis Koch9mo ago
Copy them manually. We don’t offer a command, because we don’t want people to overwrite them easily. Beware of the risks: You need to manually check whether those views are still good after updates.
Gabor
Gabor3mo ago
I see that this thread is a bit old, so I hope it’s alright for me to write here. As the original author already mentioned, I’m also at the point where I need to modify the templates/components. I’ve read both this article and the documentation (link) which suggest that this isn’t generally recommended. However, due to a specific design template I’m working with, I have no other option but to manually adjust the Blade components and the sidebar. My question is, how can I apply this to a specific panel? I was thinking about using lifecycle hooks (link). Would I just need to adjust View::addNamespace for that?
Filament
Overriding the Filament PanelProvider by Shaung Bhone - Filament
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
Dennis Koch
Dennis Koch3mo ago
My question is, how can I apply this to a specific panel?
As you are overriding the files anyway:
@if (Filament::getCurrentPanel() === 'your-id')
here comes your tempalte
@else
default template
@endif
@if (Filament::getCurrentPanel() === 'your-id')
here comes your tempalte
@else
default template
@endif
Gabor
Gabor3mo ago
Thank you very much, and sorry for the late response. Would there perhaps be another way? Like specifying which Blade namespace path should be used in a particular panel? That could get a bit complicated in certain places. If that's not possible, I'd be happy to take a look at it. If desired or if it makes sense, I can also submit a PR.
Dennis Koch
Dennis Koch3mo ago
As we don't discourage people from overriding their view files, there aren't any methods for this and I don't think a PR makes sense.
Want results from more Discord servers?
Add your server