open-southeners/laravel-model-status
Lightweight Laravel model status handling using native PHP enums—no extra tables needed. Define a status enum, attach it via a PHP attribute, and use a trait for helpers like setStatus, setStatusWhen, hasStatus, and optional status events.
$defaultStatus protected static propertyHasStatuses trait: swappingStatusName, swappedStatusName. Do not confuse with saving, saved Eloquent events, these are triggered from setStatus & setStatusWhen functions, so may you always use thesesetStatus and setStatusWhen functions doesn't return self, instead they return always true when not saving, true or false otherwiseStatusEnumCaseName attribute cast now returns defaultStatus if defined on the trait, null otherwiseBackedEnum::tryFrom throwing deprecation warnings when argument is nullofStatuses query scope to HasStatuses traittoArray / toJson Laravel model methodsopen-southeners/laravel-helpers dependency (not gonna use UnitEnums)open-southeners/laravel-helpersHow can I help you explore Laravel packages today?