| Total Complexity | 3 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Authenticate extends Middleware |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Get the path the user should be redirected to when they are not authenticated. |
||
| 11 | * |
||
| 12 | * @param \Illuminate\Http\Request $request |
||
| 13 | * @return string|null |
||
| 14 | */ |
||
| 15 | protected function redirectTo($request) |
||
| 16 | { |
||
| 17 | |||
| 18 | if (! ($request->expectsJson() || collect($request->route()->middleware())->contains('api'))) { |
||
| 19 | return route('login'); |
||
| 20 | } |
||
| 24 |