skip to Main Content
public function masuk(Request $request)
{
    $this->validate($request, [
        'USERNAME_ACC'   => 'required',
        'PASSWORD' => 'required'
    ]);
    $username=$request->get('USERNAME_ACC');
    $password=$request->get('PASSWORD');

    // $pass=HASHBYTES('md5',$password);
    // dd($pass);

    

    $cek_user = User::where('USERNAME_ACC',$request->USERNAME_ACC)->where('PASSWORD',DB::raw("HASHBYTES('md5','$password')"))->count();
    // dd($result->toArray());
    if ($cek_user==0) {
        return redirect('/login')->with('gagal','Username or Password Not Register');
    }else {
        $user=User::where('USERNAME_ACC',$request->USERNAME_ACC)->where('PASSWORD',DB::raw("HASHBYTES('md5','$password')"))->first();
        if (Auth::guard('web')->login($user))
        {
            return redirect()->intended('admin');
        }
        return "Gagal";
    }
}

How can i login with custome Hash in Laravel

i use HashBytes(‘mD5’) for my encryption

So Please Help Me Guyss!!

2

Answers


  1. I think Laravel has an authentication system, you can read more about it on their site

    Login or Signup to reply.
  2. Edit the config/hashing.php file and put the one you need, it is responsible for the encoding driver

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search