PHP Architect · Vol 21, Issue 7 · July 2022
Artisan Way: Refactor to Enums in Laravel
by Marian Pop
You can create a custom type that is limited to one of a discrete number of potential values by using enumerations, sometimes known as “Enums.” Because it allows for “making incorrect states unrepresentable,” this is particularly useful when constructing a domain model.
The full article is in PHP Architect Vol 21, Issue 7. Subscribe to read it and every new issue.