> laravel-api
REST and JSON API standards for modern Laravel backends. Use when designing REST endpoints, API resources, or JSON API responses in Laravel. (triggers: routes/api.php, app/Http/Resources/**/*.php, resource, collection, sanctum, passport, cors)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/laravel-api?format=md"Laravel API
Priority: P1 (HIGH)
Structure
app/
└── Http/
├── Resources/ # Data transformation
└── Controllers/
└── Api/ # API specific logic
Implementation Guidelines
- API Resources: Always use Resources/Collections for JSON formatting.
- RESTful Actions: Follow standard naming (
index,store,update). - Auth: Use Sanctum for SPAs/Mobile or Passport for OAuth2.
- Status Codes: Return appropriate HTTP codes (201 Created, 422 Unprocessable).
- Versioning: Prefix routes with version tags (e.g.,
api/v1/...). - Rate Limiting: Configure
RateLimiterto protect public endpoints.
Anti-Patterns
- Raw Models: No raw model returns: Information leakage risk.
- Manual JSON: No response()->create(): Use API Resources.
- Session Auth: No sessions for APIs: Use Tokens (Sanctum).
- Hardcoded URLs: No static links in JSON: Use HATEOAS or route names.
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)