我正在尝试自定义]中未经身份验证的功能>
App \ Exceptions \ Handler.php
根据卫队重定向用户和管理员,但$ exception-> guards()返回null,这是什么问题?
protected function unauthenticated($request, AuthenticationException $exception)
{
if($request->expectsJson())
return response()->json(['message' => $exception->getMessage()], 401);
dd($exception->guards());
return redirect()->guest(route('login'));
}
我正在尝试在App \ Exceptions \ Handler.php中定制未经身份验证的功能,以根据防护将用户和管理员重定向,但是$ exception-> guards()返回null,这是什么问题? ...
使用Illuminate\Support\Arr;