darkmode

Hi everyone, How to enable darkmode only for admin users? thanks
Solution:
I think you need to create a middleware and apply it according to this role... ```php public function handle(Request $request, Closure $next): Response {...
Jump to solution
2 Replies
Solution
LeandroFerreira
LeandroFerreira5mo ago
I think you need to create a middleware and apply it according to this role...
public function handle(Request $request, Closure $next): Response
{
filament()->getCurrentPanel()->darkMode(auth()->user()->is_admin);
return $next($request);
}
public function handle(Request $request, Closure $next): Response
{
filament()->getCurrentPanel()->darkMode(auth()->user()->is_admin);
return $next($request);
}
Ontamine&Vue
Ontamine&VueOP5mo ago
It works, Thank you so much
Want results from more Discord servers?
Add your server