Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 protected function onPost(\Illuminate\Http\Request $input)
 {
     return parent::onPost($input);
 }