laravel-api | Skill Performance & Reviews | TopRankSkills

TopRank Skills

Home / Skills / development / laravel-api

laravel-api

maintained by HoangNguyen0403

star 305 account_tree 90 verified_user MIT License
bolt View GitHub

name: Laravel API description: REST and JSON API standards for modern Laravel backends. Use when designing REST endpoints, API resources, or JSON API responses in Laravel. metadata: labels: [laravel, api, rest, json, sanctum] triggers: files: ['routes/api.php', 'app/Http/Resources/**/*.php'] keywords: [resource, collection, sanctum, passport, cors]

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 RateLimiter to 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

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!

Skill Details

GitHub Stars 305
GitHub Forks 90
Created Mar 2026
Last Updated 5个月前
development development cms platforms

Related Skills

ui-ux-pro-max
chevron_right
building-agents
chevron_right
ui-ux-pro-max
chevron_right
prisma-expert
chevron_right
nestjs-expert
chevron_right

Build your own?

Join 12,000+ developers contributing to the Claude ecosystem.