Handle multi panel authentication

how can you handle this authentication in middleware. I have 3 panels lawyer, lecturer and admin. I want if admin login in lawyer login incorrect credentials

class RedirectIfNotLawyer
{
/**
  • Handle an incoming request.
    *
  • @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next*/public function handle(Request $request, Closure $next): Response{ $user = auth()->user(); if (! $user || ! $user->hasAnyRole(['User', 'Pending'])) { return redirect()->route('filament.lawyer.auth.login'); } return $next($request);}}
Was this page helpful?