Update permission action
@param  Request $request
@return Response
325927
public function update(Request $request, $id = null)
    {
        // validate data
        $validator = Validator::make($request->all(), [
            'name'         => 'sometimes|required|string|max:255|unique:permissions,name,'.$id,
            'display_name' => 'string|max:255',
            'description'  => 'max:1000'
        ]);

        if ($validator->fails()) {
            return response()->json(arrayView('phpsoft.users::errors/validation', [
                'errors' => $validator->errors()
            ]), 400);
        }

        // check permission
        $permission = Permission::find($id);

        if (!$permission) {
            return response()->json(null, 404);
        }

        // update permission
        $updatePermission = $permission->update($request->all());

        if (!$updatePermission) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(arrayView('phpsoft.users::permission/read', [
            'permission' => $permission
        ]), 200);
    }
133610
public function update(Request $request)
    {
        $data = array_get($request->input(), '2fa', []);
        return $this->processor->update($this, $data);
    }
1085558
public function update_item_permissions_check( $request ) {

		$id = (int) $request['id'];

		$comment = get_comment( $id );

		if ( $comment && ! $this->check_edit_permission( $comment ) ) {
			return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you can not edit this comment.' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}
470953
public function update(Request $request, $id)
    {
        $model = (new Services\GroupsPermissionsService)->dataUpdate($id, $request->all());
        $route = config('acl.routes.groups-permissions.edit');
        return redirect()->route($route, $id)->with('success', 'Permissões atualizadas com sucesso');
    }
1350313
public function update(Request $request)
    {
        // Carregar ID
        $id = $this->getId($request);

        // Carregar objeto JSON
        $obj = $this->getJsonContent($request);
        if (is_null($obj)) {
            $this->error('JSON invalid', 500);
        }

        // Salvar
        $this->setValues($obj, $id);

        return response()->json((object)['success' => true]);
    }
796344
public function update(Request $request)
    {
        $post = $this->api('post.fetch', $request->route('post'))->get();

        $this->authorize('edit', $post);

        $post = $this->api('post.update', $request->route('post'))->parameters($request->only('content'))->patch();

        Forum::alert('success', 'posts.updated');

        return redirect(Forum::route('thread.show', $post));
    }
1306198
public function updateSettings(Request $request)
    {
        $this->authorize('update', Settings::class);

        Settings::first()->update([
            'stripe_key'    => $request->stripe_key ? encrypt($request->stripe_key) : null,
            'stripe_secret' => $request->stripe_secret ? encrypt($request->stripe_secret) : null,
        ]);

        return redirect()->route('laralum::settings.index', ['p' => 'Payments'])->with('success', __('laralum_payments::general.updated_settings'));
    }
861093
public function update(Update $request, $id)
    {
        try {
            $permission = $this->repository->findById($id);

            $data = $request->all();

            $permission->update($data);

            return $this->redirect('permissions.index');
        } catch (ModelNotFoundException $e) {
            return $this->redirectNotFound();
        }
    }
639114
public function update(Permission $permission)
    {
        $this->validate($this->request, [
            'name'     => 'required',
            'resource' => 'required|alpha_num',
            'slug'     => 'required|unique:permissions,slug,' . $permission->id,
        ]);

        $permission->name     = $this->request->get('name');
        $permission->resource = $this->request->get('resource');
        if (! $permission->system) {
            $permission->slug = $this->request->get('slug');
        }
        $permission->save();

        $permission->syncRoles($this->request->get('roles', []));

        return redirect()->route('administrator.permissions.index');
    }
247970
public function update(Request $request)
    {
        if ($request->has('notification')) {
            foreach ($request->notification as $id => $severity) {
                if (in_array(strtolower($severity), ['low', 'medium', 'high', 'disabled'])) {
                    Severity::where('id', $id)->update(['severity' => strtolower($severity)]);
                }
            }
        }

        return redirect(route('eyewitness.settings.index').'#severity')->withSuccess('The notification severity settings have been updated.');
    }
1143917
public function postUserRolePermissions(Request $request)
  {
    $this->validate($request, ['role' => 'required', 'permissions' => 'required']);
    $role = Role::with('permissions')->whereName($request->role)->first();
    $role->permissions()->detach();
    foreach ($request->permissions as $permission_name) {
      $permission = Permission::whereName($permission_name)->first();
      $role->assign($permission);
    }
    \Session::flash('flash_message', 'Permission granted!');
    return \Redirect::route('admin.assign-role-permissions',[
    ]);
  }
700982
public function update($id, UpdateRequest $request)
	{
		$level = "danger";
		$message = " You are not permitted to update permissions.";

		if ( Shinobi::can ( config('watchtower.acl.permission.edit', false) ) ) {
			$permission = Permission::findOrFail($id);
			$permission->update($request->all());
			$level = "success";
			$message = "<i class='fa fa-check-square-o fa-1x'></i> Success! Permission edited.";
		}

		return redirect()->route( config('watchtower.route.as') .'permission.index')
				->with( ['flash' => ['message' => $message, 'level' =>  $level] ] );
	}
19314
public function update(Request $request, $id)
    {
      $permission = Permission::findOrFail($id)->update($request->only('name', 'label'));
      \Session::flash('flash_message', 'Permission updated!');
      return \Redirect::route('admin.permissions.index', [
        ])->withMessage(trans('acl::permission.permissions-controller-successfully_updated'));
      }
458717
public function update(UpdateUserRequest $request, User $user)
    {
        $this->authorize(UsersPolicy::PERMISSION_UPDATE);

        $user->update($request->getValidatedData());
        $user->roles()->sync($request->get('roles'));

        $this->transNotification('updated', ['name' => $user->full_name], $user->toArray());

        return redirect()->route('admin::auth.users.show', [$user->hashed_id]);
    }
1225554
public function update(Request $request, $id)
    {
      $user = $this->users->findOrFail($id);
      $input = $request->all();
      $input['password'] = Hash::make($input['password']);
      $user->update($input);
      return \Redirect::route('admin.users.index', [
        ])->withMessage(trans('acl::user.users-controller-successfully_updated'));
      }
379018
public function update($id, Request $request)
    {
        return $this->updateModel($this->model()->find($id), $request->all(), 'edit');
    }
652150
public function updateAction(Request $request)
    {
        $parameters = $this->serializer->deserialize(json_decode($request->getContent(), true));

        return new JsonResponse($parameters);
    }