调用未定义的函数auth()

时间:2018-12-31 09:08:31

标签: jwt lumen

Call to undefined function App\Http\Controllers\auth()

如果我按照提供的jwt-auth的逐步说明进行操作

我已复制粘贴此AuthConstroller

$token = auth()->attempt($credentials);

Error Message: Call to undefined function App\Http\Controllers\auth()
  • 框架版本5.7.7
  • 软件包版本1.0.0-rc.2
  • PHP版本7.2.9

我的AuthController

1 个答案:

答案 0 :(得分:0)

我认为它更像是

Auth::attempt($credentials)