2022-08-12 07:56:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
2022-11-06 11:28:22 +00:00
|
|
|
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
2022-08-12 07:56:56 +00:00
|
|
|
|
2022-11-06 11:28:22 +00:00
|
|
|
class Authenticate extends Middleware
|
2022-08-12 07:56:56 +00:00
|
|
|
{
|
|
|
|
/**
|
2022-11-06 11:28:22 +00:00
|
|
|
* Get the path the user should be redirected to when they are not authenticated.
|
2022-09-08 16:12:02 +00:00
|
|
|
*
|
2022-11-16 05:16:56 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
*
|
2022-11-06 11:28:22 +00:00
|
|
|
* @return string|null
|
2022-09-08 16:12:02 +00:00
|
|
|
*/
|
2022-11-07 01:18:26 +00:00
|
|
|
protected function redirectTo($request)
|
|
|
|
{
|
2022-11-16 05:16:56 +00:00
|
|
|
if (!$request->expectsJson()) {
|
2022-11-07 01:18:26 +00:00
|
|
|
return route('index');
|
|
|
|
}
|
|
|
|
}
|
2022-08-12 07:56:56 +00:00
|
|
|
}
|