Update the specified resource in storage.
PUT /compte/{id}

@param  int  $id
@return Response
12381
public function update($id,Request $request)
    {
        $email = $this->emails->update( $request->all() );

        alert()->success('Email mis à jour');

        return redirect('build/liste/'.$email->list_id);
    }
364147
public function update($id, array $data)
    {
        $model = $this->read($id)->fill($data);
        return $model->save();
    }
90208
public function update($id) {
		$rules    = [];
		$nicename = [];
		foreach (\L::all() as $l) {
			$nicename['name_'.$l] = trans('admin.name_'.$l);
			$rules['name_'.$l]    = 'required';
		}
		$this->validate(request(), $rules, [], $nicename);
		session()->flash('success', trans('admin.updated'));
		$data = request()->except(['_token', '_method', 'parent']);
		if (request()->input('parent') != null) {
			$data['parent'] = request('parent');
		} else {
			$data['parent'] = null;
		}
		$data['admin_id'] = admin()->user()->id;

		if (request()->hasFile('icon')) {
			$dep = Dep::find($id);
			!empty($dep->icon)?Up::del_icon($dep->icon):'';// Delete Icon If Has File
			$data['icon'] = it()->upload(request()->file('icon'), 'departments/'.time(), 'icon');
		}

		if (request()->has('color')) {
			$data['color'] = request('color');
		}

		Dep::where('id', $id)->update($data);
		return back();
	}
800595
public function update($id)
    {
        $request = $this->makeRequest('update');
        $model = $this->service->update($request, $id);

        if(is_a($model, \Exception::class)) {

            return $this->getErrorResource($model);

        } else {

            return $this->maybeMakeResource('single', $model, 201);
        }
    }
991468
public function update($id, $content)
    {
        $comment = $this->client->put(
            sprintf('buckets/%d/comments/%d.json', $this->bucket, $id),
            [
                'json' => [
                    'content' => $content,
                ],
            ]
        );

        return  new Comment($this->response($comment));
    }
754018
protected function __apiUpdate(string $id)
    {
        $data = $this->getInputData();

        $record = HCStreets::findOrFail($id);


        $record->update(array_get($data, 'record'));
        $record->city_parts()->sync(array_get($data, 'city_parts'));

        return $this->apiShow($record->id);
    }
121727
public function update($id)
    {
        // set schema to sql
        $this->sql->setSchema($this->schema);
        // get data from sql
        $body = $this->sql->get($this->schema->getPrimaryFieldName(), $id);

        if (!is_array($body) || empty($body)) {
            return false;
        }

        try {
            return $this->resource->update(
                [
                    'index' => $this->schema->getName(),
                    'type' => static::INDEX_TYPE,
                    'id' => $id,
                    'body' => [
                        'doc' => $body
                    ]
                ]
            );
        } catch (Missing404Exception $e) {
            return false;
        } catch (NoNodesAvailableException $e) {
            return false;
        } catch (\Throwable $e) {
            // catch all throwable
            // if something went wrong, dont panic, just return false
            return false;
        }
    }
1151597
public function actionUpdate($id)
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['update']);
        }
        if($model = $this->findModel($id)){
            //($model->save());die();
            if ($model->load(Yii::$app->request->post())&& $model->save()) {
                //Helper::invalidate();

                return ['success'=>true];
            }else {
                throw new \yii\web\ServerErrorHttpException();
            }
        }
        throw new \yii\web\ServerErrorHttpException();
    }
875714
public function update($id)
    {
        try
        {
            $update = $this->repo->update($id, Input::all());
        } catch (ValidationErrorException $exception)
        {
            return $this->respondNotValid($exception);
        }

        if ( ! $update)
        {
            return $this->respondNotFound();
        }

        $item = $this->repo->getById($id);

        return $this->response->item($item, new $this->transformerClass);
    }
1178554
public function put($id)
    {
        $request = $this->getDI()->get('request');
        // supply everything the request object could possibly need to fullfill the request
        $put = $request->getJson($this->getControllerName('singular'), $this->model);

        if (!$put) {
            throw new HTTPException('There was an error updating an existing record.', 500, [
                'dev' => 'Invalid data posted to the server',
                'code' => '568136818916816'
            ]);
        }

        if(method_exists($this->model, "getBlockColumns")) {
            // filter out any block columns from the posted data
            $blockFields = $this->model->getBlockColumns();
            foreach ($blockFields as $key => $value) {
                unset($put->$value);
            }
        }

        $put = $this->beforeSave($put, $id);
        $id = $this->entity->save($put, $id);
        $this->afterSave($put, $id);

        // reload record so we can return it
        $result = $this->entity->findFirst($id);

        if ($result->countResults() == 0) {
            // This is bad. Throw a 500. Responses should always be objects.
            throw new HTTPException('There was an error retrieving the just updated record.', 500, [
                'dev' => 'The resource you requested is not available after it was just updated',
                'code' => '1238510381861'
            ]);
        } else {
            return $result;
        }
    }
1370484
public function update(Request $request, $id)
    {
        $response = $this->repository->update($id, $request->all());
        return Response::apiResponse([
            'data' => $response
        ]);

    }
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'));
        }
    }
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();
        }
    }
522022
public function update($id, $data)
    {
        $message = $this->client->put(
            sprintf('buckets/%d/messages/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new Message($this->response($message));
    }
169860
public function update(Request $request, $id)
    {
        $campagne = $this->campagne->update($request->all());

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

        return redirect('build/campagne/'.$campagne->id);
    }
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,
]);
}
}
104190
public function update(?string $id)
    {
        $url = self::$base_url.'/'.($id ?? $this->container_id).'/update';

        $request = json_encode($request = $this->hostConfig);

        return self::$curl->post($url, $request, self::$header);
    }