我尝试过这款Laravel Auth,但每次都会返回'no'。
$logging_user = array(
'user_name' => 'abcde',
'user_password'=> Hash::make('11111')
);
if (Auth::attempt($logging_user)) {
return 'yes';
}
else {
return 'no';
}
我的表结构是这样的
users {
id,
user_name,
user_password,
user_email
}
我的模型User.php已经实现了UserInterface
//inherited
public function getAuthIdentifier() {
return $this->getKey();
}
//inherited
public function getAuthPassword() {
return $this->user_password;
}
//inherited
public function getReminderEmail() {
return $this->user_email;
}
答案 0 :(得分:0)
我通过更改
意外修复了它$logging_user = array(
'user_name' => 'abcde',
'user_password'=> Hash::make('11111')
);
到
$logging_user = array(
'user_name' => 'abcde',
'password'=> Hash::make('11111')
);