3 回答

TA貢獻1943條經(jīng)驗 獲得超7個贊
自定義登錄 100% 無需授權即可工作,
use Hash;
$data->password = Hash::make(($request->password)); Encript Password
public function requestEmployee(Request $request)
{
if ($data = AddEmployee::where('name', $request->name)->first()) {
$pass = Hash::check($request->password, $data->password);
if ($pass) {
echo "sucess";
} else {
echo "Password Not Valid";
}
} else {
echo "Username Not Valid" . "<br>";
}
}

TA貢獻1829條經(jīng)驗 獲得超6個贊
請嘗試一下:
public function login()
{
request()->validate([
'email' => 'required',
'password' => 'required'
]);
$credentials = array(
"email" => request("email"),
"password" => request("password")
);
if (Auth::attempt($credentials)) {
return 'exit!';
}
return 'Error';
}

TA貢獻1890條經(jīng)驗 獲得超9個贊
$password=Hash::check($request->password,$user->password);
使用它會返回 true 或 false
或者只是使用
$credentials = array(
"email" => request("email"),
"password" => request("password")
);
沒有 bcrypt
- 3 回答
- 0 關注
- 236 瀏覽
添加回答
舉報