An array of transitionable states can be retrieved with the
transitionableStates() method on your model.
class Payment extends Model
protected function registerStates(): void
$transitionableStates = $payment->transitionableStates(Pending::class);
This will return an array with all transitionable states for
0 => "paid"
Transitionable states from state
It's also possible to use
transitionableStates() method directly on a state:
Multiple state fields on model
If there are multiple fields, a
\Spatie\ModelStates\Exceptions\InvalidConfig exception will be thrown. You can pass the state field name explicitly as a parameter: