f8988082

562 经验值

已解决

/**
     * Convert an authentication exception into an unauthenticated response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Illuminate\Auth\AuthenticationException  $exception
     * @return \Illuminate\Http\Response
     */
    protected function unauthenticated($request, AuthenticationException $exception)
    {
        if ($request->expectsJson()) {
            return response()->json(['error' => 'Unauthenticated.'], 401);
        }

        return redirect()->guest(route('login'));
    }

新创建的一个laravel只装了passport

api路由给了auth:api后怎么一直提示Route [login] not defined.啊

已解决


return $this->hasOne(Wallet::class, 'wallet_uid', 'user_id')->select('wallet_cash');

为什么返回null啊