如何在$this->auth->authenticate()这样的调用中找到authenticate的位置?

想研究一下laravel auth的一些东西,找到了这样的一个文件,请问如何找到$this->auth->authenticate()中authenticate的定义地方呢?想看下代码

如何在$this->auth->authenticate()这样的调用中找到authenticate的位置?

《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
最佳答案

你这是哪个版本的框架?更新下框架再看吧?相关的authenticate()方法在Illuminate\Auth\GuardHelpers

    public function authenticate()
    {
        if (! is_null($user = $this->user())) {
            return $user;
        }

        throw new AuthenticationException;
    }

其中的$this->user()方法是指实现了Illuminate\Contracts\Auth\StatefulGuard接口的几个类:Illuminate\Auth\RequestGuardIlluminate\Auth\SessionGuardIlluminate\Auth\TokenGuard其中之一,具体是哪一个,是根据config/auth.phpguards.web.driver的值判断的。默认值是session,那么对应的就是Illuminate\Auth\SessionGuard中的user()方法。

2年前 评论
讨论数量: 5

你这是哪个版本的框架?更新下框架再看吧?相关的authenticate()方法在Illuminate\Auth\GuardHelpers

    public function authenticate()
    {
        if (! is_null($user = $this->user())) {
            return $user;
        }

        throw new AuthenticationException;
    }

其中的$this->user()方法是指实现了Illuminate\Contracts\Auth\StatefulGuard接口的几个类:Illuminate\Auth\RequestGuardIlluminate\Auth\SessionGuardIlluminate\Auth\TokenGuard其中之一,具体是哪一个,是根据config/auth.phpguards.web.driver的值判断的。默认值是session,那么对应的就是Illuminate\Auth\SessionGuard中的user()方法。

2年前 评论

@LiamHao 我是5.5的版本~

2年前 评论

@LiamHao 非常感谢,已经找到了,确实是这个位置!想问下您,有没有快捷键可以调到这里还是说只能熟悉框架后人工去找呢?

2年前 评论
LiamHao 2年前

你这个工具 皮肤叫什么名字 感觉挺好看的

2年前 评论

@ahkxhyl 用的是phpstorm 字体是

file

2年前 评论
zzzzzzmmmmm 2年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!