Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Authenticate | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| redirectTo | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Middleware; |
| 4 | |
| 5 | use Illuminate\Auth\Middleware\Authenticate as Middleware; |
| 6 | use Illuminate\Http\Request; |
| 7 | |
| 8 | class Authenticate extends Middleware |
| 9 | { |
| 10 | /** |
| 11 | * Get the path the user should be redirected to when they are not authenticated. |
| 12 | */ |
| 13 | protected function redirectTo(Request $request): ?string |
| 14 | { |
| 15 | // return $request->expectsJson() ? null : route('login'); |
| 16 | return $request->expectsJson(); |
| 17 | } |
| 18 | } |