Route [login] not defined

前端 未结 14 1898
無奈伤痛
無奈伤痛 2020-12-02 15:15

Trying to play with Laravel today for the first time. I am getting the following error when I attempt to visit localhost/project/public:

InvalidArgume

14条回答
  •  时光说笑
    2020-12-02 16:00

    In app\Exceptions\Handler.php

    protected function unauthenticated($request, AuthenticationException $exception)
    {
        if ($request->expectsJson()) {
            return response()->json(['error' => 'Unauthenticated.'], 401);
        }
    
        return redirect()->guest(route('auth.login'));
    }
    

提交回复
热议问题