protected function onPost(\Illuminate\Http\Request $input) { $id = $input->get('id'); $this->data['update_success'] = false; try { $obj = Category::createFromInput($input, $id); $this->data['update_success'] = true; } catch (\App\Exceptions\Validation $ex) { $this->data['errors'] = $ex->validator->errors(); } catch (\Exception $ex) { $this->errors->add('update-error', $ex->getMessage()); } return parent::onPost($input); }
protected function onPost(\Illuminate\Http\Request $input) { $id = $input->get('id'); $this->data['update_success'] = false; try { Category::find($id)->delete(); $this->data['delete_success'] = true; return $this->redirect($this->plugin->categories_url()); } catch (\App\Exceptions\Validation $ex) { $this->data['errors'] = $ex->validator->errors(); } catch (\Exception $ex) { $this->errors->add('delete-error', $ex->getMessage()); } return parent::onPost($input); }
protected function onPost(\Illuminate\Http\Request $input) { $this->data['create_success'] = false; try { $obj = User::createFromInput($input); $this->data['create_success'] = true; $this->view = 'admin.users.edit'; $this->data['user'] = $obj; return $this->redirect($this->plugin->users_url('update', ['id' => $obj->id])); } catch (\App\Exceptions\Validation $ex) { dd($this->input); $this->data['errors'] = $ex->validator->errors(); } catch (\Exception $ex) { $this->errors->add('create-error', $ex->getMessage()); } return parent::onPost($input); }
protected function onPost(\Illuminate\Http\Request $input) { return parent::onPost($input); }