Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function handle(Request $request, Closure $next, string $guard = 'admin'): Response |
||
22 | { |
||
23 | if (Auth::guard($guard)->check()) { |
||
24 | return $next($request); |
||
25 | } |
||
26 | |||
27 | $redirectToRoute = $request->expectsJson() ? '' : route('admin.login'); |
||
28 | |||
29 | throw new AuthenticationException( |
||
30 | 'Unauthenticated.', |
||
31 | [$guard], |
||
32 | $redirectToRoute |
||
33 | ); |
||
36 |