Laravel Enums
Laravel Enums simplifies creating and managing enum types in your Laravel applications, boosting code clarity and type safety.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add laravel-enums npx -- -y @trustedskills/laravel-enums
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"laravel-enums": {
"command": "npx",
"args": [
"-y",
"@trustedskills/laravel-enums"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill enables AI agents to generate and manage Laravel Enum classes, streamlining the definition of typed constants for states, statuses, or categories within a PHP application. It automates the creation of both stringable and integer-based enums to ensure type safety and cleaner code logic.
When to use it
- Defining new application states like user roles (e.g.,
active,pending,banned) that require consistent string values across the codebase. - Creating status trackers for order lifecycles or workflow stages where specific named constants are needed.
- Replacing magic strings with typed enums to prevent typos and improve IDE autocomplete support during development.
Key capabilities
- Generates
Stringableenum implementations compatible with modern Laravel versions. - Supports the creation of integer-based enums for database storage efficiency.
- Automatically handles the necessary trait imports and class structure required by Laravel.
Example prompts
- "Create a Laravel Enum for user statuses including 'active', 'inactive', and 'suspended'."
- "Generate an integer-based enum for order states like 'pending', 'processing', and 'completed'."
- "Write a Stringable enum for payment methods such as 'credit_card', 'paypal', and 'bank_transfer'."
Tips & gotchas
Ensure your Laravel version supports the Stringable interface before generating these enums, as older versions require manual trait implementation. Always verify that generated constants match your specific business logic requirements to avoid runtime errors.
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.