authentication in codeignither 4

Asked

Viewed 12 times

-1

I try to make an authentication system but always gives a problem in the query it always passes as falso.

$values = [
             'name'=>$name,
             'email'=>$email,
             'password'=>Hash::make($password)
         ];

$usersModel = new \App\Models\UsersModel();
$query = $usersModel->insert($values);
if(!$query){
    return redirect()->back()->with('fail','Something went wrong');
}else{
   $last_id = $usersModel->insertID();
   session()->set('loggedUser',$last_id);
   return redirect()->to('/dashboard');
}
  • Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.

  • What is the type of return of the method $usersModel->insert?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.