Created
January 6, 2022 16:27
-
-
Save mseptiaan/2023f2d081006b388ef0844e7d5e99e4 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