/** Remove the specified resource from storage. @param $rekanan @return Response */ public function postDelete($rekanan) { // Declare the rules for the form validation $rules = array('idkode' => 'required'); // Validate the inputs $validator = Validator::make(Input::all(), $rules); // Check if the form validates with success if ($validator->passes()) { $idkode = $rekanan->kdrek; $rekanan->delete(); // Was the blog rekanan deleted? $rekanan = Rekanan::find($idkode); if (empty($rekanan)) { // Redirect to the blog rekanans management page return Redirect::to('admin/rekanans')->with('success', Lang::get('admin/rekanans/messages.delete.success')); } } // There was a problem deleting the blog rekanan return Redirect::to('admin/rekanans')->with('error', Lang::get('admin/rekanans/messages.delete.error')); }
public function save_user_rekanan($id) { $data = Rekanan::find($id); $data->email_rkn = Input::get('username'); $data->save(); if (!empty(Input::get('password'))) { $password = Input::get('password'); /*$user->password = Hash::make($password); $user->get_pass = $password;*/ $user = user::where('id_users', $id)->update(array('password' => Hash::make($password), 'username' => Input::get('username'), 'get_pass' => $password)); } else { $user = user::where('id_users', $id)->update(array('username' => Input::get('username'))); } if ($user > 0) { echo "ok"; } else { echo "error"; } }