app/Http/Controllers/Controller.php
/**
     * Accepts an eloquent model, and the current request instance, using the request data to update the
     * fields of the model based on the configuration of the updateFields array.
     *
     * @param Model   $model
     * @param Request $request
     */
Accepts an eloquent model, and the current request instance, using the request data to update the
fields of the model based on the configuration of the updateFields array.

@param Model   $model
@param Request $request
Accepts an eloquent model and the current request instance using the request data to update the fields of the model based on the configuration of the updateFields array . @param Model $model @param Request $request
protected function updateModelAttributes(Model &$model, Request $request)
    {
        if (empty($this->updateFields)) {
            throw new \UnexpectedValueException('The update fields were not configured for the endpoint.');
        }
        foreach ($this->updateFields as $requestKey => $modelKey) {
            if (!$request->has($requestKey)) {
                continue;
            }
            $model->{$modelKey} = $request->input($requestKey);
        }
    }
protected function updateModelAttributes ( Model & $ model , Request $ request ) { if ( empty ( $ this -> updateFields ) ) { throw new \ UnexpectedValueException ( 'The update fields were not configured for the endpoint.' ) ; } foreach ( $ this -> updateFields as $ requestKey => $ modelKey ) { if ( ! $ request -> has ( $ requestKey ) ) { continue ; } $ model -> { $ modelKey } = $ request -> input ( $ requestKey ) ; } }
Accepts an eloquent model, and the current request instance, using the request data to update the
 fields of the model based on the configuration of the updateFields array.
Accepts an eloquent model and the current request instance using the request data to update the fields of the model based on the configuration of the updateFields array .
# doesn't have it, so we skip the key