一键导入
service-layer
Defines application service structure and business orchestration boundaries
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Defines application service structure and business orchestration boundaries
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Defines structural rules for Laravel architecture, layering, and code organization
Defines DTO structure, lifecycle, and transformation rules across the application
Governs safe, incremental, repository-wide development workflow with continuous validation gates
Ensures correct execution order of migrations, seeders, and tests in CI
Defines the schema-to-factory-to-seeder contract chain — NOT NULL alignment, factory/seeder ownership boundaries, and schema drift rules
Defines GitHub Actions configuration for running PHP/Laravel CI pipeline
| name | service-layer |
| description | Defines application service structure and business orchestration boundaries |
| license | MIT |
| metadata | {"author":"project"} |
Services are the only place business logic lives. They are framework-agnostic.
Services MUST:
Services MUST NOT:
app() or resolve() internallyConstructor injection only:
public function __construct(
private InvoiceRepository $repository
) {}
DTOs are not required when the source is a validated FormRequest::validated()
array. Arrays are fine there.
Use DTOs when:
Skip DTOs when:
app/Services/{Domain}/{Model}Service.php
e.g. app/Services/Task/TaskService.php, app/Services/Offer/OfferService.php.
Standard method names: create, update, delete, findByExternalId. Prefer
one service class per domain holding both create/update (see TaskService)
over splitting into separate per-action service classes.