laravel-architecture
Provides architectural patterns and standards for building scalable Laravel applications.
Install
mkdir -p .claude/skills/laravel-architecture && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1876" && unzip -o skill.zip -d .claude/skills/laravel-architecture && rm skill.zipInstalls to .claude/skills/laravel-architecture
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Enforce core architectural standards for scalable Laravel applications. Use when structuring controllers, service layers, action classes, Form Requests, or Service Container bindings in Laravel projects.Key capabilities
- →Structure controllers, services, and action classes
- →Implement Form Requests for validation
- →Bind interfaces in the Service Container
- →Refactor legacy codebases to scalable patterns
How it works
The skill enforces a strict architectural pattern where controllers are kept slim, logic is moved to Action classes, and dependencies are managed via the Service Container.
Inputs & outputs
When to use laravel-architecture
- →Structuring a new Laravel project
- →Refactoring legacy Laravel codebases
- →Applying design patterns to Laravel services
About this skill
Laravel Architecture
Priority: P0 (CRITICAL)
Structure
See project structure for recommended directory layout.
Workflow
- Create Form Request for validation (
php artisan make:request StoreUserRequest). - Create Action class with single
handle()method for use case. - Inject Action into controller via constructor DI.
- Bind interfaces in
AppServiceProviderfor swappable implementations.
Controller Pattern
See implementation examples for slim controller, action class, and service container binding patterns.
Validation
- Use Form Requests with
authorize()andrules()methods. - Call
$request->validated()in controller for mass assignment. - Never use inline
$request->validate().
Anti-Patterns
- No logic in Controllers: Move to Services or Action classes.
- No manual instantiation: Use Service Container via DI.
- No inline
$request->validate(): Favor Form Request classes. - No excessive global helpers: Use class-based logic instead.
References
Canonical response anchors
When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:
-
No logic in
-
Additional task-grounded exact anchors: handle()
When not to use it
- →Writing logic directly inside controllers
- →Using inline request validation
Prerequisites
Limitations
- →Requires adherence to specific directory structures
- →Action classes must use a single handle() method
How it compares
It mandates a specific separation of concerns that prevents the common anti-pattern of bloated controllers in Laravel.
Compared to similar skills
laravel-architecture side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| laravel-architecture (this skill) | 7 | 1mo | No flags | Intermediate |
| php-best-practices | 15 | 1mo | No flags | Beginner |
| php-guidelines-from-spatie | 6 | 6mo | No flags | Beginner |
| fluent-validation-migrate-messages | 0 | 1mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by HoangNguyen0403
View all by HoangNguyen0403 →You might also like
php-best-practices
HoangNguyen0403
PHP best practices, PSR standards, and code quality guidelines.
php-guidelines-from-spatie
freekmurze
Describes PHP and Laravel guidelines provided by Spatie. These rules result in more maintainable, and readable code.
fluent-validation-migrate-messages
angelgarciasolorzano
Migrate FormRequest `messages(): array` to inline `message:` on fluent chains. Dry-run, then apply. Activates when: user mentions migrate messages, messages array, inline message, remove messages().
laravel-patterns
helmordev
Laravel architecture patterns, routing/controllers, Eloquent ORM, service layers, queues, events, caching, and API resources for production apps.
codeigniter-architecture-patterns
berthelemy
Use when: designing or refactoring feature architecture in CodeIgniter for maintainability, separation of concerns, and module consistency.
php-pro
ngxtm
Use when building PHP applications with modern PHP 8.3+ features, Laravel, or Symfony frameworks. Invoke for strict typing, PHPStan level 9, async patterns with Swoole, PSR standards.