
Dynamic Color For Panels Per Users
By: Lara Zeus
- Published: 24 Mar 2024 Updated: 04 May 2024
let users select a color for the panel

1return app(StartSession::class)
2 ->handle($request, function ($request) use ($next) {
3 if (! auth()->check()) {
4 return $next($request);
5 }
6
7 FilamentColor::register([
8 'primary' => constant("Filament\Support\Colors\Color::".auth()->user()->primary_color),
9 ]);
10
11 return $next($request);
12});
the attribute primary_color
will contain the tailwind color name like Sky
.

Related Tricks:
Dynamic Color For Panels Per Users
let users select a color for the panel
Add background content blur for all modal and slide overs
better UI to make the content blur
Larament - Your Time-Saving Laravel Starter Kit
This time-saving starter kit provides a Laravel project with FilamentPHP already installed and configured, so you can dive straight into building without any of the initial setup headaches.