You're encrypting the string 'password' instead of the password parameter sent with your form.
public function update($id)
{
$datas = User::find($id);
$datas->password = bcrypt(Input::get('password'));
$datas->admin = Input::get('admin');
$datas->save();
return redirect()->action('UsersController@index');
}
Neoglyph said:
You're encrypting the string 'password' instead of the password parameter sent with your form.
public function update($id) { $datas = User::find($id); $datas->password = bcrypt(Input::get('password')); $datas->admin = Input::get('admin'); $datas->save(); return redirect()->action('UsersController@index'); }
Thanks men i used other style of codes but your code helps me a lot.
$datas = User::findOrFail($id); // Validate the new password length... $datas->admin = Input::get('admin'); $datas->fill([ 'password' => Hash::make($request->password) ])->save(); return redirect()->action('UsersController@index');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community