Laravel Value Objects
This skill generates reusable Laravel value objects, promoting code consistency and simplifying data modeling for robust applications.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add laravel-value-objects npx -- -y @trustedskills/laravel-value-objects
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"laravel-value-objects": {
"command": "npx",
"args": [
"-y",
"@trustedskills/laravel-value-objects"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides Laravel Value Objects, which are immutable data transfer objects that encapsulate a specific value and related logic. They help enforce business rules and ensure data integrity within your Laravel applications by providing type safety and preventing accidental modification of critical data. This promotes cleaner code and reduces potential errors in complex systems.
When to use it
- Data Validation: Use Value Objects to encapsulate validation logic for specific data points, ensuring only valid values are stored or processed.
- Business Rule Enforcement: Implement business rules directly within the Value Object's methods, guaranteeing consistent application of those rules across your application.
- API Data Transformation: Transform and sanitize incoming API data into a standardized format using Value Objects before persisting it to the database.
- Domain Modeling: Represent core domain concepts as Value Objects to improve code clarity and maintainability within your Laravel project.
Key capabilities
- Immutable data structures
- Encapsulation of business logic
- Type safety for values
- Improved code clarity and maintainability
Example prompts
- "Generate a
Moneyvalue object with methods for adding, subtracting, and formatting currency." - "Create a
Percentagevalue object that validates input between 0 and 100." - "Show me how to use the
DateRangevalue object in my Laravel application."
Tips & gotchas
- Requires a working Laravel project.
- Value Objects are immutable, so ensure all necessary transformations or calculations are performed during creation.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.