How to change color palette dynamically

My application is multitenant and I would like to change the color palettes according to the client, I currently change them in the serviceprovider, could anyone help me how to change the dynamic pain
No description
Solution:
FilamentPHP Glow
let users select a color for the panel
Jump to solution
8 Replies
Solution
Lara Zeus
Lara Zeus7mo ago
FilamentPHP Glow
let users select a color for the panel
LeandroFerreira
LeandroFerreira7mo ago
maybe using $panel->bootUsing(function(){..}) in the panel..
Leonardy
LeonardyOP7mo ago
Thank you very much!
Leonardy
LeonardyOP7mo ago
Have you tested it yet? I didn't understand these two returns in the middleware
Lara Zeus
Lara Zeus7mo ago
you mean return $next($request); ? it the default return for all laravel middleware it mean continue the next request
Leonardy
LeonardyOP7mo ago
would it look like this?
No description
awcodes
awcodes7mo ago
Just put the FilamentColor inside the if and don’t use ! To negate it. Also not sure what constant() is doing.
If($request->user) {
FilamentColor::register([
‘primary’ => Color::hex($request->user->primary_color)
])
}
If($request->user) {
FilamentColor::register([
‘primary’ => Color::hex($request->user->primary_color)
])
}
Something like that. You have to be aware of if the color is actually registered with Filament or not. Also depends on how the color is stored for the user. Is it a key, hex or rgb.
Leonardy
LeonardyOP7mo ago
Got it, thanks for the contribution. I'll do some tests here
Want results from more Discord servers?
Add your server