Exemple #1
0
 public function update_user(UserRequest $request, $username)
 {
     $user = User::whereUsername($username)->firstOrFail();
     $newpassword = input::get('password');
     $oldpassword = User::findOrFail(5)->password;
     if (bcrypt::check($newpassword, $oldpassword)) {
         $tes = User::findOrFail(5);
         $tes->password = bcrypt::make(input::get('newpassword'));
         $tes->save();
     } else {
         var_dump('gagal');
     }
     $input = $request->all();
     return redirect()->route('admin::user');
 }