Custom Styling Panel
We make use of Laravel Tenancy and different Panels. So for example:
landlord.test -> will go to AdminPanelProvider
tenant.test -> will go to TenantPanelProvider
We want every tenant to be able to customize their styling of their panel, with own primary color, secondary color, logo and favicon. Is it possible to make this dynamic based on the settings of this tenant and what is the best way to get this done? For example we can store the colors and images paths in the database or is this something we can use? https://filamentglow.com/trick/dynamic-color-for-panels-per-users-1837d9c6
Thanks in advance!
7 Replies
Was able to do it like this with creating an middleware (thanks to @Lara Zeus):
Does anyone got an idea if this is also possible with brandLogo & favicon?
Does anyone got an idea if this is also possible with brandLogo & favicon?Doesn't it work? You would use
Filament::getCurrentPanel()
Thanks for your reply, this working but every user is in the same panel and filled the logo/favicon there but want to overwrite it in the same middleware as above?
Or are there better options?
Sorry, I don't understand your question
No worries and thanks for your time @Dennis Koch. I think i'm not clearly enough - i will explain a bit more:
We are building an multi-tenancy application and the TenantPanel should be whitelabel. But right now i set in the TenantPanelProvider those values:
What i want to get done is as user1 is logging in brandLogo & favicon should show logo-user1.svg and favicon-user1.svg for example.
Same for user2, etc.
Basically get the styling colors (done with above example), but looking for the solution to also be able to change brandLogo and favicon based on user.
So with this middleware, i'm already changing the colors based on the user that is logged in but want to know if there is also something you can do to change the brandLogo / Favicon.
Like:
Yes. You can access the current panel in the middleware as mentioned above and then use
brandLogo()
. I think it should work. Anything unclear with that?Wow... way easier than i tought. Thank you so much, all clear!
For further me's. You can create an middleware and add this: