2018-03-13 16:09:47 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
2023-01-03 09:35:24 +00:00
|
|
|
use Illuminate\Http\Request;
|
2018-03-13 16:09:47 -05:00
|
|
|
|
|
|
|
|
class Authenticate extends Middleware
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Get the path the user should be redirected to when they are not authenticated.
|
|
|
|
|
*/
|
2023-01-03 09:35:24 +00:00
|
|
|
protected function redirectTo(Request $request): string|null
|
2018-03-13 16:09:47 -05:00
|
|
|
{
|
2023-01-03 09:35:24 +00:00
|
|
|
return $request->expectsJson() ? null : route('login');
|
2018-03-13 16:09:47 -05:00
|
|
|
}
|
|
|
|
|
}
|