Grant is a Laravel package that lets you define roles and permissions as PHP enums, stores assignments in the database, and routes all checks through Laravel's Gate so can(), Gate::authorize(), and @can work out of the box.
Go beyond basic enum casting. Learn how to wire PHP 8.3 enums into Eloquent, bind them as route model parameters, and write reusable validation rules — all with full type safety and zero boilerplate.
Go beyond primitive storage with Eloquent's CastsAttributes contract. Build reusable value-object casts, handle composite columns, and encrypt sensitive fields without a single accessor.
Go beyond basic enum casting. Learn how to wire PHP 8.3 backed enums into Eloquent, route model binding, and custom validation rules to eliminate stringly-typed code across your Laravel application.
PHP 8.1 enums changed how we model domain state. This article shows how to wire backed enums into Eloquent casts, form validation rules, and route binding — with PHP 8.3 typed constants making everything tighter.
PHP 8.3 backed enums combined with Laravel's native enum casting unlock type-safe domain models. Learn how to wire enums into Eloquent, validation, and API resources without ceremony.
PHP 8.3 and Laravel's native enum support unlock expressive, type-safe domain models. Learn how to combine backed enums, custom Eloquent casts, and readonly properties to eliminate primitive obsession without ceremony.
Go beyond simple enum labels. Learn how to attach behaviour, implement interfaces, and use backed enums as Eloquent casts, route bindings, and validation rules without polluting your models.
PHP 8.1 backed enums are more than constants. Learn how to attach behaviour, use them as Eloquent casts, embed them in value objects, and write expressive domain logic without a single string literal.
Have a technical challenge?
Tell me what you’re building. I reply within two working days.