【发布时间】:2018-06-24 01:55:56
【问题描述】:
我正在使用lumen 5.1.*,但每当我使用 Auth 时,它都会抛出错误
AuthManager.php 第 16 行中的 ErrorException:缺少参数 1 Illuminate\Auth\AuthManager::createDriver(),调用 D:\xampp\htdocs\project\vendor\illuminate\support\Manager.php 上线 87和定义
谁能帮我解决这个问题。我需要在流明中使用Auth::user()
public function postLogin(Request $request){
if (Auth::attempt(['email' => $request->email, 'password' => $request->password])) {
// Authentication passed...
echo "success";
echo "<pre>";
print_r(Auth::user()->toArray());
} else {
echo "sorry erorr occured";
}
}
【问题讨论】:
-
你的
Auth::attempet();在哪里?我可以看看吗? -
@EtibarRustemzade.我更新了问题
-
if (Auth::attempt(['email' => $request->email, 'password' => $request->password, 'activated' => 1]));你检查了吗? -
@ya 不工作,甚至 auth::user() 也不工作
-
auth()->user();辅助函数在流明中工作
标签: php laravel laravel-5 lumen