← ClaudeAtlas

labrodev-datalisted

Use when creating, reviewing, or naming Spatie Data classes (*Data), UUID/collection casters (*UuidCaster, *CollectionCaster), or any write-side input validation in a Labrodev Laravel project — including rules(), attributes(), prepareForPipeline(), relation-via-UUID mapping, and nested Data. Also use when someone reaches for a FormRequest: Data classes are the only validation layer.
labrodev/laravel-playbook · ★ 0 · Data & Documents · score 73
Install: claude install-skill labrodev/laravel-playbook
# Data and Validation (Spatie Laravel Data) Part of the Labrodev playbook. **The law for this component lives in the always-on `labrodev-data` guideline** (musts, must-nots); the per-file checklist is `rules/data.md`. This skill holds the craft: anatomy, canonical templates, and edge cases. This skill covers the full write-side surface: the Data class template, the four-part UUID relation contract, object and collection casters, and where validation may and may not reach. ## Data class template Naming pattern: `{Model}Data` — the shared create/update default and when a split into `{Model}CreateData` / `{Model}UpdateData` is legitimate → `labrodev-data` guideline and "Edge cases" below. Namespace: `Core\Domain\{Domain}\Data`. Full naming rules and the mirror-variable rule (`BookingData $bookingData`, never `$data`) → see the labrodev-naming skill. ```php <?php declare(strict_types=1); namespace Core\Domain\Booking\Data; use Core\Domain\Booking\Enums\BookingChannel; use Core\Domain\Extra\Casts\ExtraCollectionCaster; use Core\Domain\Extra\Collections\ExtraCollection; use Core\Domain\Service\Casts\ServiceUuidCaster; use Core\Domain\Service\Models\Service; use Illuminate\Validation\Rule; use Spatie\LaravelData\Attributes\DataCollectionOf; use Spatie\LaravelData\Attributes\WithCast; use Spatie\LaravelData\Data; use Spatie\LaravelData\DataCollection; final class BookingData extends Data { /** * @param DataCollection<int, BookingGuestData> $guests */ publ