Authenticate.php (409B)
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 } 17 }