labrodev-enumlisted
Install: claude install-skill labrodev/laravel-playbook
# Enums (the full enum contract)
Part of the Labrodev playbook. **The law for this component lives in the always-on `labrodev-enum` guideline** (musts, must-nots); the per-file checklist is `rules/enums.md`. This skill holds the craft: anatomy, canonical templates, and edge cases.
Enums represent constrained domain values: statuses, types, modes — any field with a finite allowed set and matching logic. When an enum crosses a boundary, the **full enum contract** applies (the law → `labrodev-enum` guideline). Its four parts map onto the sections below:
| # | Boundary | Contract |
|---|----------|------|
| 1 | Enum class | Backed scalar enum, model-prefixed name, `label(): string` wrapping `trans()` |
| 2 | Data class (write side) | Typed enum property (implicit Spatie cast) + `Rule::enum(EnumClass::class)` |
| 3 | Model (persistence) | Enum cast declared in the `casts()` **method** |
| 4 | Frontend (Inertia props) | Resources emit `value` + `*_label` pairs; ViewModels build options via `EnumMapper::keyValues()` |
## 1) Enum anatomy — canonical template
Naming pattern: `{Model}{Aspect}` (e.g. `BookingStatus`, `BookingChannel`, `ProductType`), namespace `Core\Domain\{Domain}\Enums`. Full class/method naming rules → see the labrodev-naming skill.
```php
<?php
declare(strict_types=1);
namespace Core\Domain\Booking\Enums;
enum BookingStatus: int
{
case Pending = 1;
case Confirmed = 2;
case Cancelled = 3;
public function label(): string
{
return