Skip to content

Spread ​

File: src/Entities/Spread.php
Namespace: Unusualify\Modularous\Entities
Extends: Illuminate\Database\Eloquent\Model

Stores dynamic key-value JSON data attached to a parent model via a polymorphic relationship. Acts as an extension mechanism to add arbitrary fields to a model without schema changes.

Fillable Attributes ​

AttributeTypeDescription
spreadable_idintParent model ID
spreadable_typestringParent model class
contentarrayDynamic data (JSON cast)

Relationships ​

spreadable(): MorphTo ​

The parent model this spread data belongs to.

Table ​

Resolved from modularous.tables.spreads, defaults to um_spreads.

  • HasSpreadable — trait that adds spread support to models
  • Company — uses spreads for flexible billing fields