Skip to content

Stateable ​

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

Polymorphic pivot model that links a State to any model using the HasStateable trait. Timestamps are enabled to track when a state was assigned.

Fillable Attributes ​

AttributeTypeDescription
state_idintThe state being assigned
stateable_idintTarget model ID
stateable_typestringTarget model class

Relationships ​

state(): BelongsTo ​

The state definition. The model class is resolved from modularous.models.state, defaulting to Unusualify\Modularous\Entities\State.

Table ​

Resolved from modularous.tables.stateables, defaults to um_stateables.

  • State — the state definition
  • HasStateable — trait that manages state relationships