Get the path the user should be redirected to when they are not authenticated.
Parameters
\Illuminate\Http\Request
$request
Returns
string
Authenticate.php
<?phpnamespaceApp\Http\Middleware;useIlluminate\Auth\Middleware\Authenticateas Middleware;classAuthenticateextendsMiddleware{/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string
*/protectedfunctionredirectTo($request){if(!$request->expectsJson()){returnroute('login');}}}