I’m tryna add new user by form. I use myth-auth for auth but it seems the data doesn’t added yet the view return in table user. Here my save method:
public function save()
{
$this->_user_model->withGroup($this->request->getVar('role'))->insert([
'nama_lengkap' => $this->request->getVar('nama_lengkap'),
'email' => $this->request->getVar('email'),
// 'password_hash' => password_hash($this->request->getVar('password'), PASSWORD_BCRYPT),
'password_hash' => Password::hash("123456"),
'prodi' => $this->request->getVar('prodi'),
'no_hp' => $this->request->getVar('no_hp'),
]);
session()->setFlashdata('success', 'Berhasil Menambahkan User!');
return $this->response->redirect(site_url('manage_users'));
// return redirect()->to(site_url('manage_users'));
}
I want the user have some default psw so when the user login they can change the psw later. I look at myth-auth documentation and some tutorial. It says that this will work, but it doesn’t. Maybe I miss something? Thank you.
I’ve tried some other way like insert it with builder. but it didn’t work either. I want the user to have some default psw so when the user login they can change the psw later. I look at myth-auth documentation and some tutorial. It says that this method will work, but it doesn’t. Maybe I miss something? Thank you.