Backend\Traits\FormModelWidget

FormModelWidget Trait

Special logic for for form widgets that use a database stored model.

Public methods

public array resolveModelAttribute(string $attribute)

Returns the final model and attribute name of a nested HTML array attribute. Eg: [$model, $attribute] = $this->resolveModelAttribute($this->valueFrom);

Parameters
  • string $attribute - .

Protected methods

protected Relation getRelationModel()

Returns the model of a relation type, supports nesting via HTML array.

protected Relation getRelationObject()

Returns the value as a relation object from the model, supports nesting via HTML array.

protected Relation getRelationType()

Returns the value as a relation type from the model, supports nesting via HTML array.