Update the specified resource in storage.

@param    \Illuminate\Http\Request  $request
@param    int  $id
@return  \Illuminate\Http\Response
180026
public function update($id,Request $request)
    {
        $setting = Setting::findOrfail($id);
    	
        $setting->name = $request->name;
        
        $setting->description = $request->description;
        
        
        $setting->save();

        return redirect('setting');
    }
685843
public function update(Request $request, $id)
    {
        $this->roles->findOrFail($id)->update($request->only('name', 'label'));
        return \Redirect::route('admin.roles.index', [
         ])->withMessage(trans('acl::role.roles-controller-successfully_updated'));
    }
960184
public function update($id,Request $request)
    {
        $feature = Feature::findOrfail($id);
    	
        $feature->name = $request->name;
        
        $feature->description = $request->description;
        
        $feature->featuretype_id = $request->featuretype_id;

        $feature->demonstration_URL = $request->demonstration_URL;

        $feature->package_id = $request->package_id;       
        
        $feature->save();

        return redirect('feature');
    }
1096764
public function putAction(Request $request, $id)
    {
        $this->checkAccess('PUT', $id);
        $resource = $this->getResourceManager()->find($id);
        return $this->processPut($request, $resource);
    }
1168971
public function update (Request $request , $id)
    {
        if ($category = $this->category->where('id' , $id)->first()) {

            foreach ($request->except(['_token']) as $key => $val) {
                if (Schema::hasColumn('categories' , $key))
                    $category->{$key} = $val;
            }

            $slug = new Slugger($this->modelType);
            $slug = $slug->updateSlug($category , $request->input('slug') , $request->input('title'));
            $category->slug = $slug;

            $category->save();
            return $category;
        } else
            throw new CategoryException(trans('Categories::category.error-message.categoryNotExist'));

    }
418959
public function update(Request $request, $id = null)
    {
        /*
         * Update pagetypes
         * All, single, and mass updating
         */

        // Set roles that have access
        $request->user()->authorizeRoles(['admin']);

        // Set pagetypes to a collection
        $pagetypes = collect();

        if ($id && is_string($id)) {
            // Update 1 post according to id
            $pagetypes[] = PageType::findOrFail($id);
        } elseif ($id && is_array($id)) {
            // Update all in array
        } else {
            // Update all pagetypes from sources
            $pagetypes = self::getAllPagetypes();
        }

        foreach ($pagetypes as $pagetype) {

            if ($id && is_string($id)) {
                $existing_pagetype = PageType::findOrFail($pagetype->id)->first();
            } else {
                $existing_pagetype = PageType::where('model', get_class($pagetype))->first();
            }

            // Validate $pagetype content
            if (!$pagetype->name || !$pagetype->description) {
                dd($pagetype->model . ' was missing attributes for name or description');
            }

            // Check if it already exist in db, and update/save accordingly
            if (!$existing_pagetype) {
                // Get and set all required attributes
                $pagetype->model = get_class($pagetype);

                // Get declared fields
                if (method_exists($pagetype, 'setFields')) {
                    $pagetype->fields = $pagetype->setFields();
                }

                // Save
                $pagetype->save();
            } else {
                // Get and set all required attributes
                $existing_pagetype->name = $pagetype->name;
                $existing_pagetype->description = $pagetype->description;

                // Get new declared fields
                if (method_exists($pagetype, 'setFields')) {
                    $existing_pagetype->fields = $pagetype->setFields();
                }

                // Update
                $existing_pagetype->touch();
                $existing_pagetype->update();
            }
        }

        return back();
    }
507428
public function update(Request $request, $id)
	{
		$entity = UUID::findOrFail($id)->entity;
		return ResourceController::resolveController($entity)->update($entity);
	}
3028
public function update($id, Request $request)
    {
        //BUSCAR ID
        $post = $this->noticiaRepo->findOrFail($id);

        //VALIDACION DE DATOS
        $this->validate($request, $this->rules);

        //VARIABLES
        $titulo = $request->input('titulo');
        $slug_url = SlugUrl($titulo);
        $categoria = $request->input('categoria');
        $tags = $request->input('tags');

        //GUARDAR DATOS
        $post->slug_url = $slug_url;
        $post->categoria_id = $categoria;
        $row = $this->noticiaRepo->update($post, $request->all());

        //GUARDAR TAGS
        ($tags <> '') ? $row->tags()->sync($tags) : false;

        //MENSAJE
        flash()->success('El registro se actualizó satisfactoriamente.');

        //REDIRECCIONAR A PAGINA PARA VER DATOS
        return redirect()->route('admin.noticias.index');
    }
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);
    }
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();
    }
217917
public function editAction(Request $request, $id)
    {
        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

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

        $model = $this->findOr404Error($id);
        $form = $crudConfigurator->getForm($model);

        return $this->createOrUpdate($request, $model, $form, Constants::ACTION_UPDATE, $crudConfigurator->getTemplate()->getEdit());
    }
1236237
public function update(Request $request, $id)
    {
        $abstract = sprintf('themosis.metabox.%s', $id);

        try {
            $metabox = $this->manager->saveFields(app($abstract), $request);
        } catch (\Exception $exception) {
            return response()->json([
                'message' => $exception->getMessage(),
                'errors' => true
            ], 500);
        }

        return response()->json($metabox->toArray());
    }
641723
public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var BusinessTemplate $pagePattern */
        $pagePattern = $em->getRepository('VictoireBusinessPageBundle:BusinessTemplate')->find($id);

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

        $editForm = $this->createEditForm($pagePattern);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            //redirect to the page of the template
            $completeUrl = $this->generateUrl('victoire_business_template_show', ['id' => $pagePattern->getId()]);
            $message = $this->get('translator')->trans('victoire.business_template.edit.success', [], 'victoire');

            $success = true;
        } else {
            $success = false;
            $completeUrl = null;
            $message = $this->get('translator')->trans('victoire.business_template.edit.error', [], 'victoire');
        }

        return new JsonResponse([
            'success' => $success,
            'url'     => $completeUrl,
            'message' => $message,
        ]);
    }
999135
public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            "name" => "required|max:36",
            "description" => "required|max:128",
        ]);
        $memberCategory = MemberCategory::findOrFail($id);
        $this->authorize('update', $memberCategory);
        $memberCategory->name = $request->name;
        $memberCategory->description = $request->description;
        $memberCategory->update();
        return fractal($memberCategory, new MemberCategoryTransformer())
            ->withResourceName('memberCategory')
            ->respond();
    }
696407
public function update($id, Request $request)
    {
        $entity = $this->getEntityById($id);

        if (!$entity) {
            return $this->response(null, Response::HTTP_NOT_FOUND);
        }

        $params = $request->only($this->fillable);

        $result = $this->manager->update($entity, $params);

        if (!$result->ok()) {
            return $this->response(['errors' => $result->getSimpleErrors()], Response::HTTP_BAD_REQUEST);
        }

        return $this->response($this->serialize($result->getResource(), $request), Response::HTTP_OK);
    }
192339
public function putAction($id, Request $request)
    {
        $response = $this->getResponse();
        $model = $this->getModel();

        $this->restUtils->checkJsonRequest($request, $response, $this->getModel());
        $record = $this->restUtils->validateRequest($request->getContent(), $model);

        // handle missing 'id' field in input to a PUT operation
        // if it is settable on the document, let's set it and move on.. if not, inform the user..
        if ($record->getId() != $id) {
            // try to set it..
            if (is_callable(array($record, 'setId'))) {
                $record->setId($id);
            } else {
                throw new MalformedInputException('No ID was supplied in the request payload.');
            }
        }

        // And update the record, if everything is ok
        if (!$this->getModel()->recordExists($id)) {
            $this->getModel()->insertRecord($record, false);
        } else {
            $this->getModel()->updateRecord($id, $record, false);
        }

        // Set status code
        $response->setStatusCode(Response::HTTP_NO_CONTENT);

        // store id of new record so we dont need to reparse body later when needed
        $request->attributes->set('id', $record->getId());

        return $response;
    }
126291
public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            "countryCode" => 'required|regex:/\d{1,2}/',
            "label" => "required|max:50",
            "phoneNumber" => 'required|regex:/\d{10}/',
        ]);
        $phone = Phone::findOrFail($id);
        $this->authorize('manage', $phone);
        $phone->country_code = $request->countryCode;
        $phone->label = $request->label;
        $phone->phone_number = $request->phoneNumber;
        $this->authorize('manage', $phone);
        $phone->save();
        return fractal($phone, new PhoneTransformer())
            ->withResourceName('phone')
            ->respond();

    }