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

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

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

《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
最佳答案

你这是哪个版本的框架?更新下框架再看吧?相关的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()方法。

3年前 评论
讨论数量: 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()方法。

3年前 评论

@LiamHao 我是5.5的版本~

3年前 评论

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

3年前 评论
LiamHao 3年前

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

3年前 评论

@ahkxhyl 用的是phpstorm 字体是

file

3年前 评论
zzzzzzmmmmm 3年前

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