How to make a hashed authentication? so made this login function for my project, and my teacher asked me to make this login with hash and bcrypt, but I have no idea about that
public function login(Request $request)
{
$kredensil = $request->only('username', 'password');
if (Auth::attempt($kredensil)) {
$users = Auth::user();
if($users->level == 'admin'){
return redirect()->intended('admin/siswa');
}
elseif ($users->level == 'siswa') {
return redirect()->intended('siswa/home');
}
return redirect('login')->with('error', 'Login gagal harap cek username dan password');
}
return redirect('login')->with('error', 'Login gagal harap cek username dan password');
}