laravel-api

Design Laravel REST APIs with Eloquent Resources, pagination, and rate limiting.

1|Updated Aug 27, 2025
One-click install
npx skills add https://github.com/bmadigan/ask-my-doc --skill laravel-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-api
Source: https://github.com/bmadigan/ask-my-doc/tree/main/.claude/skills/laravel-api
Command: npx skills add https://github.com/bmadigan/ask-my-doc --skill laravel-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured approach to building production-ready RESTful APIs using Laravel, ensuring consistent data transformation, routing, and security patterns across projects.

Core Features & Use Cases

  • Resource-driven APIs: Use Eloquent API Resources and Collections to shape JSON responses consistently for models.
  • Pagination, Versioning & Rate Limiting: Implement scalable data access with pagination, API version prefixes, and request throttling.
  • Robust Practices: Includes controllers, form requests, routes, and tests to enforce validation, eager loading, and secure access across endpoints.
  • Use Case: For a multi-model application (posts, users, comments), you would expose versioned endpoints like /api/v1/posts with standardized responses and token-based authentication.

Quick Start

Install Laravel project dependencies and scaffold API structure; create resources, controllers, requests, routes, and tests to expose a RESTful API.

Frequently Asked Questions about laravel-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Laravel REST API with consistent JSON responses?

Structure a Laravel REST API by using Eloquent API Resources and Collections to shape model data into consistent JSON responses. This approach ensures standardized data transformation across multiple models and endpoints in real-world applications.

What's the best way to implement pagination and rate limiting in a Laravel API?

Implement pagination and rate limiting in a Laravel API by configuring scalable data access controls and request throttling. These features enforce secure access and prevent endpoint overload across versioned API routes.

How do I set up versioned API routes in Laravel?

Set up versioned API routes in Laravel by applying API version prefixes to your endpoint definitions. This practice isolates changes and maintains consistent access across multiple model endpoints like /api/v1/posts.

Does this Laravel API approach handle validation and eager loading automatically?

This Laravel API approach enforces validation via Form Requests and optimizes queries using eager loading. These robust practices are integrated directly into the controllers and requests to secure and streamline endpoint execution.

What dependencies do I need to build a production-ready Laravel REST API?

Building a production-ready Laravel REST API requires PHP, Laravel, Composer, and a standard toolchain. These dependencies are necessary to scaffold the API structure and execute the included tests.

Can I use this to scaffold controllers and tests for multiple models?

You can use this to scaffold controllers, form requests, routes, and tests for multiple models. It delivers structured, production-ready API components for real-world projects handling resources like posts, users, and comments.