Created
January 6, 2022 16:27
-
-
Save mseptiaan/13a59d3b8ce1ee2b7c6a13e4c16bbdac to your computer and use it in GitHub Desktop.
description
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Illuminate\Auth\Middleware\Authenticate as Middleware; | |
class Authenticate extends Middleware | |
{ | |
/** | |
* Get the path the user should be redirected to when they are not authenticated. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @return string|null | |
*/ | |
protected function redirectTo($request) | |
{ | |
if (! $request->expectsJson()) { | |
return route('login'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment