Update the throttle status for a given user

@author Steve Montambeault
@link   http://stevemo.ca

@param $id
@param $action

@return \Illuminate\Http\RedirectResponse
968500
public function putStatus($id, $action)
    {
        try
        {
            $this->users->updateThrottleStatus($id,$action);
            return Redirect::route('cpanel.users.index')
                ->with('success', Lang::get('cpanel::throttle.success',array('action' => $action)));

        }
        catch (UserNotFoundException $e)
        {
            return Redirect::route('cpanel.users.index')
                ->with('error', $e->getMessage());
        }
        catch (\BadMethodCallException $e)
        {
            return Redirect::route('cpanel.users.index')
                ->with('error', "This method is not suported [{$action}]");
        }
    }
107730
public function updateRolePermissions($id, Request $request)
	{
		$level = "danger";
		$message = " You are not permitted to update role permissions.";

		if ( Shinobi::can ( config('watchtower.acl.role.permissions', false) ) ) {
			$role = Role::findOrFail($id);
			if ($request->has('slug')) {
				$role->permissions()->sync( $request->get('slug') );
			} else {
				$role->permissions()->detach();
			}
			$level = "success";
			$message = "<i class='fa fa-check-square-o fa-1x'></i> Success! Role permissions updated.";
		}

		return redirect()->route( config('watchtower.route.as') .'role.index')
				->with( ['flash' => ['message' => $message, 'level' =>  $level] ] );
	}
754317
public function actionTaskstatusupdate($id)
    {
        $model = $this->findTaskstatusmodel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['taskstatusview', 'id' => $model->id]);
        } else {
            return $this->render('taskstatus_update', [
                'model' => $model,
            ]);
        }
    }
1236930
public function update($id, UserUpdateRequest $request)
	{
		$level = "danger";
		$message = " You are not permitted to update users.";

		if ( Shinobi::can ( config('watchtower.acl.user.edit', false) ) ) {
			$user = $this->model::findOrFail($id);
			if ($request->get('password') == '') {
        		$user->update( $request->except('password') );
    		} else {
        		$user->update( $request->all() );
    		}
			$level = "success";
			$message = "<i class='fa fa-check-square-o fa-1x'></i> Success! User edited.";
		}
		
		return redirect()->route( config('watchtower.route.as') . 'user.index')
				->with( ['flash' => ['message' => $message, 'level' =>  $level] ] );
	}
1159047
public function update(Request $request, $id)
    {
        $name = \Transliteration::clean_filename(strtolower($request->label));
        $label = $request->label;

        try
        {
          WorkflowState::where('id',$id)->update(['label' => $label, 'name' => $name]);
        }
        catch(\Illuminate\Database\QueryException $e){
            // do what you want here with $e->getMessage();
            return redirect()->route('state')->with('message', 'Error');
        }

        return redirect()->route('state')->with('message', 'Update data success');
    }
1084411
public function updateAction(Request $request, string $identifier): Response
    {
        return $this->forward(BaseUserSettingsController::class . '::updateAction', [
            'identifier' => $identifier,
        ]);
    }
548427
public function update($id)
    {
        $inputs = Input::all();
        $inputs['id'] = $id;

        try
        {
            if ( $this->form->update($inputs) )
            {
                return Redirect::route('cpanel.permissions.index')
                    ->with('success', Lang::get('cpanel::permissions.update_success'));
            }

            return Redirect::back()
                ->withInput()
                ->withErrors($this->form->getErrors());
        }
        catch ( PermissionNotFoundException $e )
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('error', Lang::get('cpanel::permissions.model_not_found'));
        }
    }
790370
public function action($page, $id, $action)
    {
        $this->authorize($action, $eloquent = app('scaffold.model'));

        $response = app('scaffold.actions')->exec('action::' . $action, [$eloquent]);

        if ($response instanceof Response || $response instanceof Renderable) {
            return $response;
        }

        return back()->with(
            'messages',
            [trans('administrator::messages.action_success')]
        );
    }
1324971
protected function _redirect($action)
    {
        $params = $this->controller()->request->params['pass'];
        $searchParams = array_diff_key(
            array_merge(
                $this->controller()->request->query,
                $this->values()
            ),
            array_flip(
                (array)$this->config('prohibitedParams')
            )
        );

        if ($this->config('filterEmptyParams')) {
            $searchParams = array_filter($searchParams);
        }
        $params['?'] = $searchParams;
        $params = array_merge($params, $searchParams);

        $params['action'] = $action;
        $this->controller()->redirect($params);
        $this->controller()->response->send();
        $this->controller()->response->stop();
    }
176720
public function actionUpdate($id)
{
$model = $this->findModel($id);

if ($model->load($_POST) && $model->save()) {
return $this->redirect(Url::previous());
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
1339360
public function updateAction($id)
    {
        $form = $this->getForm();
        // Get request
        $request = $this->get('request');
        if ('POST' == $request->getMethod()) {
            $form->submit($request);
            
            if ($form->isValid()) {
                // Save instance
                $this->getManager()->create($form->getData());
                $this->get('session')->getFlashBag()->add('success', 'Instance Redis updated successfully');

                return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Some errors found');
            }
        }
        
        return $this->render(
            $this->getTemplatePath().'edit.html.twig',
            array(
                'form' => $form->createView(),
                'errors' => $form->getErrors()
            )
        );
    }
1295072
public function update($id, UpdateRequest $request)
	{		
		$level = "danger";
		$message = " You are not permitted to update roles.";

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

		return redirect()->route( config('watchtower.route.as') .'role.index')
				->with( ['flash' => ['message' => $message, 'level' =>  $level] ] );
	}
1240833
public function actionUpdate($id) {
    Url::remember('', 'actions-redirect');
    $user = $this->findModel($id);
    $user->scenario = User::SCENARIO_UPDATE;
    $event = $this->getUserEvent($user);
    $this->performAjaxValidation($user);

    $this->trigger(self::EVENT_BEFORE_UPDATE, $event);
    if ($user->load(Yii::$app->request->post()) && $user->save()) {
      Yii::$app->getSession()->setFlash('success', Yii::t('users', 'Account details have been updated'));
      $this->trigger(self::EVENT_AFTER_UPDATE, $event);
      return $this->refresh();
    }

    return $this->render('_account', [
      'user' => $user,
    ]);
  }
559875
public function update(Request $request, $id)
    {
        $this->validate($request, [
            'subject'     => 'required|min:3',
            'content'     => 'required|min:6',
            'priority_id' => 'required|exists:ticketit_priorities,id',
            'category_id' => 'required|exists:ticketit_categories,id',
            'status_id'   => 'required|exists:ticketit_statuses,id',
            'agent_id'    => 'required',
        ]);

        $ticket = $this->tickets->findOrFail($id);

        $ticket->subject = $request->subject;

        $ticket->setPurifiedContent($request->get('content'));

        $ticket->status_id = $request->status_id;
        $ticket->category_id = $request->category_id;
        $ticket->priority_id = $request->priority_id;

        if ($request->input('agent_id') == 'auto') {
            $ticket->autoSelectAgent();
        } else {
            $ticket->agent_id = $request->input('agent_id');
        }

        $ticket->save();

        session()->flash('status', trans('ticketit::lang.the-ticket-has-been-modified'));

        return redirect()->route(Setting::grab('main_route').'.show', $id);
    }
421490
public function update(AdminUpdateRequest $request, $id)
    {

        $admin = $this->adminRepository->find($id);

        if (!is_null($admin)) {
            $this->adminRepository->update($admin, $request->all());
        }

        return Redirect::route('admin.admin.index');
    }
507428
public function update(Request $request, $id)
	{
		$entity = UUID::findOrFail($id)->entity;
		return ResourceController::resolveController($entity)->update($entity);
	}
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();
        }
    }