ldc-laravel-base-project/app/Http/Middleware/Authenticate.php

23 lines
539 B
PHP
Raw Normal View History

2022-08-01 16:20:28 +02:00
<?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.
*
2022-08-01 16:36:46 +02:00
* @param \Illuminate\Http\Request $request
2022-08-01 16:20:28 +02:00
* @return string|null
2022-08-01 16:36:46 +02:00
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
2022-08-01 16:20:28 +02:00
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}