protected function addField($name, $label = '')
    {
        $field = new Field($name, $label);

        $field->setParent($this);

        $this->overwriteExistingField($name);

        return tap($field, function ($field) {
            $this->fields->push($field);
        });
    }
protected function addField($name, $label = '')
    {
        $field = new Field($name, $label);

        $field->setParent($this);

        $this->overwriteExistingField($name);

        return tap($field, function ($field) {
            $this->fields->push($field);
        });
    }
protected function addField ( $ name , $ label = '' ) { $ field = new Field ( $ name , $ label ) ; $ field -> setParent ( $ this ) ; $ this -> overwriteExistingField ( $ name ) ; return tap ( $ field , function ( $ field ) { $ this -> fields -> push ( $ field ) ; } ) ; }
Add a model field to show.

@param string $name
@param string $label

@return Field
Add a model field to show .