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 Zeus9mo ago
FilamentPHP Glow
let users select a color for the panel
LeandroFerreira
LeandroFerreira9mo ago
maybe using $panel->bootUsing(function(){..}) in the panel..
Leonardy
LeonardyOP9mo ago
Thank you very much!
Leonardy
LeonardyOP9mo ago
Have you tested it yet? I didn't understand these two returns in the middleware
Lara Zeus
Lara Zeus9mo ago
you mean return $next($request); ? it the default return for all laravel middleware it mean continue the next request
Leonardy
LeonardyOP9mo ago
would it look like this?
No description
awcodes
awcodes9mo 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
LeonardyOP9mo ago
Got it, thanks for the contribution. I'll do some tests here

Did you find this page helpful?