laravel-api

fusengine's avatarfrom fusengine

Build RESTful APIs with Laravel using API Resources, Sanctum authentication, rate limiting, and versioning. Use when creating API endpoints, transforming responses, or handling API authentication.

0stars🔀0forks📁View on GitHub🕐Updated Jan 10, 2026

When & Why to Use This Skill

This Claude skill streamlines Laravel RESTful API development by providing standardized patterns for API Resources, Sanctum authentication, rate limiting, and versioning. It enables developers to build secure, scalable, and well-structured backend services with best practices in routing, validation, and response transformation, significantly reducing boilerplate code and ensuring architectural consistency.

Use Cases

  • Developing secure authentication systems for mobile or single-page applications (SPAs) using Laravel Sanctum.
  • Implementing API versioning strategies (e.g., v1, v2) to manage breaking changes and maintain backward compatibility for multiple client versions.
  • Transforming complex Eloquent database models into clean, consistent JSON responses using Laravel API Resources for frontend consumption.
  • Configuring advanced rate limiting and middleware to protect API endpoints from brute-force attacks and ensure service stability under high traffic.
namelaravel-api
descriptionBuild RESTful APIs with Laravel using API Resources, Sanctum authentication, rate limiting, and versioning. Use when creating API endpoints, transforming responses, or handling API authentication.

Laravel API Development

Documentation

HTTP Layer

API Features

Validation & Helpers

API Controller

<?php

declare(strict_types=1);

namespace App\Http\Controllers\Api\V1;

final class PostController extends Controller
{
    public function __construct(
        private readonly PostService $postService,
    ) {}

    public function index(): AnonymousResourceCollection
    {
        return PostResource::collection($this->postService->paginate(15));
    }

    public function store(StorePostRequest $request): JsonResponse
    {
        $post = $this->postService->create($request->validated());
        return PostResource::make($post)->response()->setStatusCode(201);
    }
}

API Routes

Route::prefix('v1')->group(function () {
    Route::get('posts', [PostController::class, 'index']);

    Route::middleware('auth:sanctum')->group(function () {
        Route::post('posts', [PostController::class, 'store']);
    });
});
laravel-api – AI Agent Skills | Claude Skills