laravel-data-writer

Community

Create clean, validated Laravel Data classes with ease.

AuthorRasmusGodske
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Creating and maintaining Laravel Data classes (Spatie) can be verbose and error-prone when properties are not promoted in the constructor, and when validation is missing or implemented via manual rules. This Skill standardizes the pattern across projects, ensuring constructor property promotion, annotation-based validation, and consistent data organization.

Core Features & Use Cases

  • Enforces constructor property promotion for all Data classes to improve readability and reliability.
  • Encourages annotation-based validation (Required, StringType, Email, etc.) and supports optional fields, collections, enums, and PHPDoc typing.
  • Guides data organization by usage context (e.g., API controllers, Inertia props, MCP tools) with nested directories for clarity and reuse.
  • Facilitates optional TypeScript export when frontend types are needed.

Quick Start

  • Create a new Data class named UserData that uses constructor property promotion, includes public string $name and public string $email with Required validation annotations, and place it under app/Data/Http/Controllers/Api/UserController/UserData.php. Then reference this Data class from your controller or API response as App\Data\Http\Controllers\Api\UserController\UserData.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: laravel-data-writer
Download link: https://github.com/RasmusGodske/claude-code-agent-communication/archive/main.zip#laravel-data-writer

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.