Update the specified resource in storage.

@param  \Illuminate\Http\Request  $request
@param  int  $id
@return \Illuminate\Http\Response
169860
public function update(Request $request, $id)
    {
        $campagne = $this->campagne->update($request->all());

        alert()->success('Campagne édité');

        return redirect('build/campagne/'.$campagne->id);
    }
1139061
public function update($id, EventRequest $request)
    {
        $event = $this->repository->find($id);

        if (empty($event)) {
            Cms::notification('Event not found', 'warning');

            return redirect(route($this->routeBase.'.events.index'));
        }

        $event = $this->repository->update($event, $request->all());
        Cms::notification('Event updated successfully.', 'success');

        if (!$event) {
            Cms::notification('Event could not be saved.', 'warning');
        }

        return redirect(URL::previous());
    }
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'));
      }
1080283
public function update(Request $request, $id)
    {
        // Handle permission
//        $request = $this->handlePermission(__FUNCTION__,$request);
//        if ($request->has('permission_filters')){
//            $filters = $request['permission_filters'];
//        }else{
        $filters = [];
//        }

        // Create Response Model
        $response = new ResponseModel();

        // Filters
        array_push($filters,
            [$this->model->getKeyName(), '=', $id]
        );

        $validationErrors = $this->checkRequestValidation($request, $this->updateValidateArray);
        if ($validationErrors != null) {
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($validationErrors->toArray()));
            }
            $response->setMessage($this->getTrans(__FUNCTION__, 'validation_failed'));
            $response->setStatus(false);
            $response->setError(99);
            return SmartResponse::response($response);

        }

        try {
            // sync many to many relation
            foreach ($this->pivotFields as $pivotField) {
                if (collect($request[$pivotField])->count()) {
                    $pivotMethod = (new StringHelper())->toCamel($pivotField);
                    $this->model->findOrFail($id)->$pivotMethod()->sync(json_decode($request[$pivotField], true));
                }
            }
            //get result of update
            $result = $this->model->where($filters)->firstOrFail()->update($request->all());

            // return response
            $response->setData($this->model
                ->where($filters)
                ->with(collect($this->updateLoad)->count() == 0 ? $this->indexLoad : $this->updateLoad)
                ->get());
            $response->setMessage(
                $this->getTrans(__FUNCTION__, 'successful1') .
                $result .
                $this->getTrans(__FUNCTION__, 'successful2')
            );

        } catch (ModelNotFoundException $exception) {
            $response->setStatus(false);
            $response->setMessage($this->getTrans(__FUNCTION__, 'model_not_found'));
            $response->setError($exception->getCode());
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }

        } catch (QueryException $exception) {
            $response->setStatus(false);
            $response->setMessage($this->getTrans(__FUNCTION__, 'failed'));
            $response->setError($exception->getCode());
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }

        }

        return SmartResponse::response($response);
    }
1354868
public function updateAction(Request $request, $id)
    {
        $this->registerBreadcrubms()->addItem($this->get("translator")->trans("Edit"));

        $entity = $this->getRepository()->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find ' . $this->getEntityName() . '.');
        }

        $form = $this->createEditForm($entity);

        $form->handleRequest($request);

        if ($form->isValid()) {
            /**
             * @var $em \Doctrine\ORM\EntityManager
             */
            $em = $this->getDoctrine()->getManager();

            try {
                if ($form->get("saveAndPublish")->isClicked()) {
                    $entity->setPublished(1);
                }
            } catch (OutOfBoundsException $e) {

            }

            if ($em->getUnitOfWork()->isScheduledForUpdate($entity)) {
                $this->get('session')->getFlashBag()->add('success', $this->getEntityName() . ' has been updated!');
            }

            $em->persist($entity);

            if (method_exists($entity, 'mergeNewTranslations')) {
                $entity->mergeNewTranslations();
            }

            $em->flush();

            if ($form->get("saveAndExit")->isClicked()) {
                return $this->redirect($this->generateUrl($this->getRouteName(), $this->getRouteParams()));
            } else {
                return $this->redirect($this->generateUrl($this->getRouteName() . 'Edit', $this->getRouteParams(['id' => $id])));
            }
        }

        return $this->render($this->getListTemplate() . ":edit.html.twig", [
            'entity' => $entity,
            'form' => $form->createView()
        ]);
    }
992515
public function update($id,Request $request)
    {
        $user_setting = User_setting::findOrfail($id);
    	
        $user_setting->user_id = $request->user_id;
        
        $user_setting->setting_id = $request->setting_id;
        
        $user_setting->notes = $request->notes;
        
        
        $user_setting->save();

        return redirect('user_setting');
    }
665632
public function update($id)
    {
        $parameters = $this->validateRequest(true);
        $model = $this->repository->update($id, $parameters);
        return $this->modelResponse($model);
    }
963392
public function crudUpdate(Request $request, $id)
    {
        try{
            $entity = $this->throwEntityNotFoundException($this->getRepository()->find($id));

            $form = $this->createForm($this->getEntityType(), $entity);
            $form->submit($request);
            
            $page = static::EDIT_VIEW;
            
            if ($form->isValid()) {
                $page = static::SHOW_VIEW;
                $this->saveEntity($entity);
                $form = $this->createDeleteForm($id)->createView();
                return $this->render($page, $this->commonsResponseVars(compact('entity','form')));
            }
            
            $form = $form->createView();
            $delete_form = $this->createDeleteForm($id)->createView();
            return $this->success($page, $this->commonsResponseVars(compact('entity','form','delete_form')));
            
        }catch(\Exception $e){
            return $this->failure($e);
        }
    }
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');
    }
504346
public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            'description' => 'max:256',
            'name' => 'required|max:32',
        ]);
        $memberTag = MemberTag::findOrFail($id);
        $this->authorize('update', $memberTag);
        if ($request->has('description')) {
            $memberTag->description = $request->description;
        }
        $memberTag->name = $request->name;
        $memberTag->save();
        return fractal($memberTag, new MemberTagTransformer())
            ->withResourceName('memberTag')
            ->respond();

    }
700611
public function update(Request $request, $id)
    {
        $node = Menu::where('id', $id)->first();

        $this->moveNode($request, $node);
        $this->updateNode($request, $node);

        return $this->response()->item($node, new NodeTransformer());
    }
31031
public function update(Request $request, $id)
    {
        $this->model = $this->model->findOrFail($id);

        $request = $this->processRequest($request);

        if ($request === true) {
            return $this->redirection();
        }

        $this->validate($request, $this->model->rules());

        $this->model->update($request->all());

        $saved = $this->afterSaving($request);

        if ($saved) {
            return $this->redirection();
        }
    }
203935
public function update(Update $request, $id)
    {
        try {
            $role = $this->repository->findById($id);

            $data = $request->all();

            $role->update($data);

            if ($role->permissions->count()) {
                $role->permissions()->detach($role->permissions->lists('id')->toArray());

                $role->permissions()->attach(\Input::get('permissions'));
            }

            if ($role->permissions->count() == 0 && count(\Input::get('permissions')) > 0) {
                $role->permissions()->attach(\Input::get('permissions'));
            }

            return $this->redirect('roles.index');
        } catch (ModelNotFoundException $e) {
            return $this->redirectNotFound();
        }
    }
1356848
public function update(UpdateRedirectRequest $request, $id)
    {
        $redirect = $this->redirect->findOrFail($id);
        $redirect->update($request->all());

        return redirect('admin/redirects');
    }
221266
public function fetch($id, Request $request)
    {
        $post = $this->model()->find($id);

        if (is_null($post) || !$post->exists) {
            return $this->notFoundResponse();
        }

        return $this->response($post);
    }
1008460
public function update(Request $request, $id)
    {
        /** @var \SymfonyId\AdminBundle\Configuration\ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $this->isGrantedOr404Error($crudConfigurator, Constants::ACTION_UPDATE);

        /** @var ModelInterface $model */
        $model = $this->findOr404Error($id);
        $form = $crudConfigurator->getForm($model, 'PUT');

        return $this->save($request, $form, $crudConfigurator);
    }
1117801
public function update($id,Request $request)
    {
        $package = Package::findOrfail($id);
    	
        $package->name = $request->name;
        
        $package->description = $request->description;
        
        $package->string_composer = $request->string_composer;
        $package->description_does_what = $request->description_does_what;
        $package->dashboard_URL = $request->dashboard_URL;
        $package->github_URL = $request->github_URL;

        
        $package->save();

        return redirect('package');
    }