/** * Update the specified permission in storage. * * @param int $id * @return Response */ public function update($id) { $permission = Permission::findOrFail($id); $validator = Validator::make($data = Input::all(), Permission::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $permission->update($data); return Redirect::route('permissions.index'); }
/** * Update the specified permission in storage. * * @param int $id * @return Response */ public function update($id) { try { $permission = $this->permissions->findOrFail($id); app('Pingpong\\Admin\\Validation\\Permission\\Update')->validate($data = $this->inputAll()); $permission->update($data); return $this->redirect('permissions.index'); } catch (ModelNotFoundException $e) { return $this->redirectNotFound(); } }
/** * Remove the specified permission from storage. * * @param int $id * @return Response */ public function destroy($id) { $permission = Permission::findOrFail($id); if (!$permission->canDelete()) { return _access_denied(); } if (!$permission->delete()) { return $this->_delete_error(); } if (Request::ajax()) { return Response::json($this->deleted_message); } return Redirect::route('permissions.index')->with('notification:success', $this->deleted_message); }
/** * Update the specified resource in storage. * PUT /permissions/{id} * * @param int $id * @return Response */ public function update($id) { $permission = \Permission::findOrFail($id); $permission->update($data = \Input::all()); return \Redirect::route('admin.permissions.index'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroyperm($id) { $permission = Permission::findOrFail($id); $permission->delete(); return Redirect::action('PermissionController@index')->with('success', Lang::get('permissions.delete_success')); }