Created
January 6, 2022 16:26
-
-
Save mseptiaan/39cb133ba37c49cc54e6ef50e4fcd81d to your computer and use it in GitHub Desktop.
description
This file contains hidden or 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