首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在NULL上对成员函attempt()调用FatalThrowableError?

如何在NULL上对成员函attempt()调用FatalThrowableError?
EN

Stack Overflow用户
提问于 2018-06-19 00:31:54
回答 1查看 0关注 0票数 0

我的申请有问题。我10个月后就没做过了。现在,我在登录表单上遇到了一个问题:

FatalThrowableError

Call to a member function attempt() on null

$this->auth似乎没有初始化.

EN

回答 1

Stack Overflow用户

发布于 2018-06-19 10:05:51

很抱歉它没有回答我的问题。

代码语言:txt
复制
trait AuthenticatesAndRegistersUsers
public function postLogin(Request $request)
    {
        $this->validate($request, [
            'email' => 'required|email', 'password' => 'required',
        ]);
         $credentials = $request->only('email', 'password');
         if ($this->auth->attempt($credentials, $request->has('remember')))
         {
            return redirect()->intended($this->redirectPath());
        }
        return redirect($this->loginPath())
        ->withInput($request->only('email', 'remember'))
        ->withErrors([
            'email' => $this->getFailedLoginMessage(),
        ]);
} 

$this->auth为空

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100004947

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档