> laravel-architecture
Core architectural standards for scalable Laravel applications. Use when structuring service layers, repositories, or scalable architecture in Laravel. (triggers: app/Http/Controllers/**/*.php, routes/*.php, controller, service, action, request, container)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/laravel-architecture?format=md"Laravel Architecture
Priority: P0 (CRITICAL)
Structure
app/
├── Http/
│ ├── Controllers/ # Slim (Request/Response only)
│ └── Requests/ # Validation logic
├── Services/ # Business logic (Optional)
└── Actions/ # Single-purpose classes (Preferred)
Implementation Guidelines
- Skinny Controllers: Keep controllers focused on routing and response.
- Service/Actions: Extract complex logic into Service or Action classes.
- Form Requests: Use
php artisan make:requestfor all validation tags. - DI usage: Inject dependencies via constructors or method injection.
- No Logic in Routes: Always delegate route closures to controllers.
- Contract First: Use Interfaces for decoupling third-party integrations.
Anti-Patterns
- Fat Controllers: No logic in Controllers: Move processing elsewhere.
- New Keyword: No Manual Instantiation: Use Service Container via DI.
- Inline Validation: No $request->validate(): Favor Form Requests.
- Global Helpers: No excessive helpers: Use class-based logic.
References
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)