且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在其他控制器中找不到Laravel Auth :: user

更新时间:2021-10-03 06:34:04

从我阅读的内容中得知.您正在使用参数CompanyController实例化UserController.

From what I read. You are instantiating the UserController with the parameter CompanyController.

此实例化是在您实际发送Auth :: login()调用之前完成的.

This instantiation is done before you have actually send the Auth::login() call.

当您在userController上运行confirmUser之前,用__construct实例化公司控制器时,对象CompanyController在进行Auth::login()调用之前就已经存在.

As you are instantiating the company controller with __construct before running confirmUser on the userController the object companyController exists before the Auth::login() call is made.