Skip to content
Back to skills

Laravel Architecture

ASecurity

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.

  • 549 stars
  • 0 votes
  • 0 copies
  • 17 views
  • Added June 6, 2026
developmentphp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned June 6, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill laravel-architecture --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Laravel Architecture?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Laravel Architecture
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-laravel-architecture/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-laravel-architecture)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: laravel-architecture
description: 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.
metadata:
  triggers:
    files:
    - 'app/Http/Controllers/**/*.php'
    - 'routes/*.php'
    keywords:
    - controller
    - service
    - action
    - request
    - container
---
# Laravel Architecture

## **Priority: P0 (CRITICAL)**

## Structure

See [project structure](references/implementation.md#project-structure) for recommended directory layout.

## Workflow

1. **Create Form Request** for validation (`php artisan make:request StoreUserRequest`).
2. **Create Action class** with single `handle()` method for use case.
3. **Inject Action** into controller via constructor DI.
4. **Bind interfaces** in `AppServiceProvider` for swappable implementations.

## Controller Pattern

See [implementation examples](references/implementation.md#controller-pattern) for slim controller, action class, and service container binding patterns.

## Validation

- Use Form Requests with `authorize()` and `rules()` 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

- [Slim Controller Patterns](references/implementation.md)

Files in this skill

  • SKILL.md1.6 KB
  • evals/evals.json2.7 KB
  • references/implementation.md1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.