Update the specified Promotions in storage.

@param int            $id
@param PromotionRequest $request

@return Response
969090
public function update($id, PromotionRequest $request)
    {
        $promotion = $this->repository->find($id);

        if (empty($promotion)) {
            Cms::notification('Promotions not found', 'warning');

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

        $promotion = $this->repository->update($promotion, $request->all());

        Cms::notification('Promotions updated successfully.', 'success');

        return redirect(url()->previous());
    }
1096434
public function update(Request $request, $id)
    {
        $this->validate($request, ['text' => 'required|max:64|regex:/^[ a-zA-Z0-9_.-]*$/']);

        $tag = Tag()::findOrFail($id);
        $tag->text = $request->text;
        $tag->save();
    }
611695
public function update($id, PagesRequest $request)
    {
        $pages = $this->repository->find($id);

        if (empty($pages)) {
            Cms::notification('Page not found', 'warning');

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

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

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

        return redirect(url()->previous());
    }
989203
public function update(Request $request, $id)
    {
        $data = $request->all();

        return $this->processor->update($this, $id, $data);
    }
964149
public function update(Request $request, $id = null)
    {
        try {
            $application = $this->applications->save($request, $id);
            if ($request->has('theme')) {
                \Cookie::queue('soda-theme', $request->input('theme'));
                $request->session()->put('soda-theme', $request->input('theme'));
            }
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.update', ['object' => 'application']));
        }

        return redirect()->route('soda.settings.edit', $application->getKey())->with('success', trans('soda::messages.updated', ['object' => 'application']));
    }
10910
public function update(SeoPagesRequest $request, $id)
    {
        $input = $request->all();

        $record = $this->model->findOrFail($id);

        $record->update($input);

        $this->notify([
            'type' => 'success',
            'title' => 'Successful update!',
            'description' => 'SeoPage is updated successfully.',
        ]);

        return redirect()->back();
    }
1181464
public function update(Request $request, $id)
    {
        $entry = $this->entriesRepository->getById($id, $this->resource);
        $this->validate($request, $this->validationRules($this->resource, $entry));

        $this->entriesRepository->update($id, $request, $this->resource);

        return redirect()->back()->with('success', 'Updated');
    }
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()
        ]);
    }
1209897
public function updateAction(Request $request, $id)
        {

            /** @var Customer $oCustomer */
            $oCustomer = CustomerQuery::create()->findOneById($id);

            if (count($oCustomer) === 0) {
                throw $this->createNotFoundException('Unable to find Customer entity.');
            }

            $deleteForm = $this->createDeleteForm($id);
            $editForm   = $this->createEditForm($oCustomer);
            $editForm->handleRequest($request);


            if ($editForm->isValid()) {


                $sLogoPath = $this->_handleLogoUpload($request, $oCustomer);
                $oCustomer->setLogo($sLogoPath);

                $oCustomer->save();

                return $this->redirect($this->generateUrl('backend_system_customer'));
            }

            return $this->render('SlashworksAppBundle:Customer:edit.html.twig', array(
                'entity'      => $oCustomer,
                'edit_form'   => $editForm->createView(),
                'delete_form' => $deleteForm->createView(),
            ));
        }
313427
public function update(Request $request, $id)
    {
        $role = Role::find($id);
        $role->fill($request->all());
        $role->save();

        session()->flash('success' , 'Rol actualizado con exito');
        return redirect()->route('roles.index');
    }
1096764
public function putAction(Request $request, $id)
    {
        $this->checkAccess('PUT', $id);
        $resource = $this->getResourceManager()->find($id);
        return $this->processPut($request, $resource);
    }
874009
public function position(OrderUpdateRequest $request, $id)
    {
        $record  = $this->modelRepository->findOrFail($id);
        $success = false;
        $result  = null;

        if ($this->getModelInformation()->list->orderable) {
            $success = true;
            $result  = $this->changeModelOrderablePosition($record, $request->get('position'));
        }

        if ($success && config('cms-models.notifications.flash.position')) {
            cms_flash(
                cms_trans(
                    'models.store.success-message-position',
                    [ 'record' => $this->getSimpleRecordReference($id, $record) ]
                ),
                FlashLevel::SUCCESS
            );
        }

        event( new Events\ModelPositionUpdatedInCms($record) );

        if (request()->ajax()) {
            return response()->json([ 'success' => $success, 'position' => $result ]);
        }

        return redirect()->back();
    }
1284898
public function update(CreatePermission $request, $id)
    {
        $permission = Permission::findOrFail($id);
		$permission->name = $request->name;
		$permission->code = $request->code;
		$permission->permission_group_id = $request->permission_group_id;
		$permission->save();
		
		return redirect(url("permission"))->with('dp_announce', trans('deeppermission.alert.permission.updated'));
    }
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());
    }
1221526
public function update(Request $request, $id)
    {
        $this->validate($request, ['name' => 'required']);

        $role = Role::findOrFail($id);
        $role->update($request->all());
        $role->permissions()->detach();

        if ($request->has('permissions')) {
            foreach ($request->permissions as $permission_name) {
                $permission = Permission::whereName($permission_name)->first();
                $role->givePermissionTo($permission);
            }
        }

        return redirect('admin/roles')->with('flash_message', 'Role updated!');
    }
269666
public function update($id, UpdateUploadRequest $request)
    {
        $upload = $this->repository->find($id);

        if (empty($upload)) {
            return $this->sendError('Upload not found');
        }
        $all = $request->all();

        $upload = $this->repository->update($all, $id);
        $upload->load($request->getWith());

        return $this->sendResponse($upload, 'Upload updated successfully.');
    }
473072
public function update(LessonUpdateRequest $request, $id)
    {
        try {
            $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_UPDATE);

//            $lesson = $this->repository->update($id, $request->all());

            $lesson = $this->repository->update($request->all(), $id);

            $response = [
                'message' => 'Lesson updated.',
                'data'    => $lesson->toArray(),
            ];

            if ($request->wantsJson()) {
                return response()->json($response);
            }

            return redirect()->back()->with('message', $response['message']);
        } catch (ValidatorException $e) {
            if ($request->wantsJson()) {
                return response()->json([
                    'error'   => true,
                    'message' => $e->getMessageBag()
                ]);
            }

            return redirect()->back()->withErrors($e->getMessageBag())->withInput();
        }
    }