Support the ongoing development of Laravel.io →
Configuration Authentication Database
Last updated 2 years ago.
0

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');
}
Last updated 8 years ago.
0

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');
Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

taneoboy taneoboy Joined 6 Feb 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.