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