public function setExtraModelValues(array $fields, &$model)
    {
        //make sure the relationships are loaded
        foreach ($fields as $name => $field) {
            if ($field->getOption('relationship')) {
                $this->setModelRelationship($model, $field);
            }

            //if this is a setter field, unset it
            if ($field->getOption('setter')) {
                $model->__unset($name);
            }
        }
    }
public function setExtraModelValues(array $fields, &$model)
    {
        //make sure the relationships are loaded
        foreach ($fields as $name => $field) {
            if ($field->getOption('relationship')) {
                $this->setModelRelationship($model, $field);
            }

            //if this is a setter field, unset it
            if ($field->getOption('setter')) {
                $model->__unset($name);
            }
        }
    }
public function setExtraModelValues ( array $ fields , & $ model ) { //make sure the relationships are loaded foreach ( $ fields as $ name => $ field ) { if ( $ field -> getOption ( 'relationship' ) ) { $ this -> setModelRelationship ( $ model , $ field ) ; } //if this is a setter field, unset it if ( $ field -> getOption ( 'setter' ) ) { $ model -> __unset ( $ name ) ; } } }
Fills a model with the data it needs before being sent back to the user.

@param array                               $fields
@param \Illuminate\Database\Eloquent\Model $model
Fills a model with the data it needs before being sent back to the user .