Update and Returns a Json Resrouce for that Record

@return \Illuminate\Http\Resources\Json\JsonResource
353701
public function update(AttributeRequest $request, Attribute $attribute)
    {
        $attribute->update($request->all());
        return new AttributeResource($attribute);
    }
944783
protected function jsonable()
    {
        return DB::connection()->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME) === 'mysql'
               && version_compare(DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), '5.7.8', 'ge')
            ? 'json' : 'text';
    }
856576
protected function getDataUpdater()
    {
        if(!isset($this->dataUpdater))
        {
            $readPreference = $this->collection->__debugInfo()['readPreference']->getMode();

            $opts = array(
                'defaultContext'=>$this->defaultContext,
                OP_ASYNC=>$this->async,
                'stat'=>$this->stat,
                'readPreference'=>$readPreference,
                'retriesToGetLock' => $this->retriesToGetLock,
                'statsConfig'=>$this->statsConfig
            );

            $this->dataUpdater = new Updates($this, $opts);
        }
        return $this->dataUpdater;
    }
834393
public function getJson()
    {
        if (!isset($this->json)) {
            $this->json = json_decode($this->getProp('dump-single-json'));
        }

        return $this->json;
    }
1339685
public function index()
    {
        return json()->setMeta($this->meta)->withPagination(
            $this->model->with('books')->latest()->paginate(5),
            new AuthorTransformer
        );
    }
961132
public function update()
    {
        /** @var \Bolt\Filesystem\Handler\JsonFile $jsonFile */
        $jsonFile = $this->app['filesystem']->get('extensions://composer.json', new JsonFile());

        if (!$jsonFile->exists()) {
            try {
                $this->init('extensions://composer.json');
            } catch (IOException $e) {
                $this->messages[] = Trans::__('page.extend.error-composer-json-not-readable');

                $this->app['extend.writeable'] = false;
                $this->app['extend.online'] = false;

                return null;
            }
        }

        $json = $jsonOrig = $jsonFile->parse();

        // Workaround Bolt 2.0 installs with "require": []
        if (isset($json['require']) && empty($json['require'])) {
            unset($json['require']);
        }

        $json = $this->setJsonDefaults($json);

        // Write out the file, but only if it's actually changed, and if it's writable.
        if ($json != $jsonOrig) {
            try {
                $jsonFile->dump($json);
            } catch (IOException $e) {
                $this->messages[] = Trans::__('page.extend.error-composer-json-not-writable');
            }
        }

        return $json;
    }
988200
public function store()
    {
        if (!Input::has('user')) {
            return $this->jsonErrorResponse('"user" is required.');
        }

        $user = Subbly::api('subbly.user')->create(Input::get('user'));

        return $this->jsonResponse(array(
            'user' => $this->presenter->single($user),
        ),
        array(
            'status' => array(
                'code'    => 201,
                'message' => 'User created',
            ),
        ));
    }
779413
def update(class_or_classname, record_id, new_attrs)
      class_or_classname = find_or_materialize(class_or_classname)
      json_for_update = coerced_json(new_attrs, class_or_classname)
      http_patch("/services/data/v#{self.version}/sobjects/#{class_or_classname.sobject_name}/#{record_id}", json_for_update)
    end
1117161
public function getJson()
    {
        global $CFG, $PDOX;

        $row = $PDOX->rowDie("SELECT json FROM {$CFG->dbprefix}{$this->TABLE_NAME}
                WHERE $this->PRIMARY_KEY = :PK",
            array(":PK" => $this->id));
        if ( $row === false ) return false;
        $json = $row['json'];
        if ( $json === null ) return false;
        return $json;
    }
447084
public function update()
    {
        try {
            $ids = func_get_args();
            $id = end($ids);
            $this->service->update($id, Input::get());

            return $this->response()->noContent();
        } catch (ValidationException $e) {
            throw new UpdateResourceFailedException('Update failed', $e->getValidationErrors());
        } catch (DomainException $e) {
            throw new UpdateResourceFailedException('Update failed', [$e->getMessage()]);
        }
    }
381771
public function outputJSON()
    {
        if (count($this->data) > 1 && $this->outputMode == self::MODE_SINGLE) {
            throw new \Exception('multiple records returned, but output-mode is single?');
        }
        return $this->formatJSON();
    }
9830
public function to_json() {
		parent::to_json();

		// We need to make sure we have the correct image URL.
		foreach ( $this->choices as $value => $args ) {
			$this->choices[ $value ]['url'] = esc_url( sprintf( $args['url'], get_template_directory_uri(), get_stylesheet_directory_uri() ) );
		}
		$this->json['choices'] = $this->choices;
		$this->json['link']    = $this->get_link();
		$this->json['value']   = $this->value();
		$this->json['id']      = $this->id;
	}
1209814
protected function getJson()
    {
        if ($this->json) {
            return $this->json;
        }
        $composer = Util::joinPaths($this->getPath(), 'composer.json');
        $file = new JsonFile($composer);
        $this->json = $file->read();
        return $this->json;
    }
501261
public function getUpdateService()
    {
        if (null == $this->updateService) {
            $this->setUpdateService(
                new EntityUpdateService($this->getNewEntity())
            );
        }
        return $this->updateService;
    }
56560
public function update(HCCountryRequest $request, string $id): JsonResponse
    {
        /** @var HCCountry $record */
        $record = $this->service->getRepository()->findOneBy(['id' => $id]);
        $record->update($request->getRecordData());
        $record->updateTranslations($request->getTranslations());

        if ($record) {
            $record = $this->service->getRepository()->find($id);

            event(new HCCountryUpdated($record));
        }

        return $this->response->success("Created");
    }
359470
public function jsonSerialize()
    {
        $ret = new StdClass;
        foreach ($this->map as $key => $value) {
            $ret->$key = (bool)($this->source & $value);
        }
        return $ret;
    }
647134
protected function jsonable(): string
    {
        $driverName = DB::connection()->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);
        $dbVersion = DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
        $isOldVersion = version_compare($dbVersion, '5.7.8', 'lt');

        return $driverName === 'mysql' && $isOldVersion ? 'text' : 'json';
    }