我在laravel中調用用戶時遇到問題,$user
假設是包含所有數組元素的數組,而自動登錄以下代碼的結果爲false。保存在數據庫中的密碼是hash::make('password')
。如何在laravel中註冊後自動登錄
$user_id = $this->user_model->addUser($user);
$post = array('password' => $pass_for_auth, 'email' => $email);
var_dump(Auth::attempt($post,true));die;
任何一個可以告訴我什麼是正確的問題
什麼這個認證等級?你能指定完整的命名空間嗎? –
@RameshPareek不需要它。它有一個別名。只是'使用認證;'它。如果你真的想要,你可以在'config/app.php'的'aliases'鍵中找到路徑,它是:'Illuminate \ Support \ Facades \ Auth'。 – totymedli