laravel-api
Laravel API guides you through building REST APIs using stateless, resource-scoped architecture with explicit boundaries between HTTP, business logic, and data layers. It enforces PSR-12 code quality, JWT authentication, versioned endpoints, and invokable controllers to establish maintainable patterns from your first resource.
Laravel API helps you build production-grade REST APIs using clean, stateless architecture with Laravel best practices.
AI-generated summary based on this skill's SKILL.md
Install
JustSteveKing/laravel-api-skill/laravel-api · repository language: Python
git clone https://github.com/JustSteveKing/laravel-api-skill
cp -r laravel-api-skill/laravel-api ~/.claude/skills/laravel-apinpx skillfed install JustSteveKing/laravel-api-skill/laravel-apiFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I build a Laravel REST API with clean architecture?
Laravel API guides you through building REST APIs using stateless, resource-scoped architecture with explicit boundaries between HTTP, business logic, and data layers. The skill emphasizes invokable controllers, Form Request DTOs, and Action classes to keep concerns separated. You'll learn to structure endpoints around resources, enforce PSR-12 code quality, and establish maintainable patterns from your first resource onward.
What's the best way to structure a Laravel API project?
Laravel API teaches resource-scoped architecture that separates HTTP concerns from business logic and data access. Use invokable controllers for single-action endpoints, Form Request classes for validation and data transfer, and Action classes for reusable business logic. This layered approach keeps your codebase readable and testable while following Laravel conventions and PSR-12 standards.
How do I add JWT auth to Laravel and set up API versioning?
Laravel API covers stateless JWT authentication for APIs and versioned endpoint design. You'll configure token-based auth to replace session cookies, implement versioning strategies to manage API evolution, and ensure each request carries authentication context without server-side state. The skill shows how to integrate these patterns into your resource routing and controller structure.
What Laravel API best practices should I follow?
Laravel API emphasizes stateless design, explicit resource routing, PSR-12 code quality, and separation of concerns through invokable controllers and Action classes. Best practices include using Form Request DTOs for validation, filtering via query builders, consistent response formatting, and avoiding anti-patterns like fat controllers or mixed business logic. These patterns ensure your API remains maintainable and scalable.
How can I review and refactor my Laravel API code for quality?
Laravel API teaches code review techniques focused on architecture boundaries, PSR-12 compliance, and design patterns. Look for violations like business logic in controllers, inconsistent response formats, or missing validation layers. Refactor by extracting Action classes, using Form Requests, and ensuring each layer has a single responsibility. The skill guides you toward readable, testable, production-grade code.
How do I scaffold new API resources following Laravel conventions?
Laravel API shows how to scaffold REST endpoints using invokable controllers, resource routing, and Form Request validation. Each resource gets a dedicated controller with single-action methods, a Form Request for input handling, and clear separation from business logic. This convention-based approach ensures consistency across your API and reduces boilerplate while maintaining clean architecture.
SKILL.md
rendered from the published skill — quoted content, verbatim
Laravel API - Steve's Architecture
Build Laravel REST APIs with clean, stateless, resource-scoped architecture.
Quick Start
When user requests a Laravel API, follow this workflow:
- Understand requirements - What resources? What operations? Authentication needed?
- Initialize project structure - Set up routing, remove frontend bloat
- Build first resource - Complete CRUD to establish pattern
- Add authentication - JWT via PHP Open Source Saver
- Iterate on remaining resources - Follow established pattern
Core Architecture Principles
Read references/architecture.md for comprehensive details.
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 9 files
laravel-api/SKILL.md
laravel-api/assets/templates/Action.php
laravel-api/assets/templates/Controller.php
laravel-api/assets/templates/FormRequest.php
laravel-api/assets/templates/Model.php
laravel-api/assets/templates/Payload.php
laravel-api/references/architecture.md
laravel-api/references/code-examples.md
laravel-api/references/code-quality.md