SR
Steven Richardson
About Articles. Skills Tools
Articles › enums
TAG ARCHIVE

Everything on enums.

3 articles tagged enums, sorted newest first.

php October 28th, 2026

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.

7 min read →
php October 20th, 2026

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.

9 min read →
php March 29th, 2026

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.

5 min read →
← Back to all articles
SR
Steven Richardson

CTO at Digitonic. Writing notes on Laravel, architecture, and the craft of leading software teams — from the west coast of Scotland.

Site

Home About Articles Skills Tools

Elsewhere

GitHub LinkedIn X RSS
© 2026 Steven Richardson
Terms Privacy Built with Laravel + Tailwind