Everything on enums.
3 articles tagged enums, sorted newest first.
Enums That Explain Themselves: __debugInfo() in PHP 8.6
Dumping a status enum has always shown you name and value and nothing you actually wanted. PHP 8.6 lets enums declare __debugInfo(), and one method covers var_dump, dd() and Ray.
PHP 8.6's SortDirection Enum: Typed Sorting in Laravel Queries and Collections
PHP 8.6 adds a global SortDirection enum, and Laravel 13 already accepts it in orderBy() and sortBy(). Here is what it does, what it deliberately does not do, and the one validation gotcha that will bite you.
Replacing String Constants with PHP Backed Enums in Laravel Models
String constants like STATUS_PENDING are typo-prone, unautocompleted, and impossible to enumerate exhaustively. PHP backed enums fix all of that: and Laravel has native support throughout.