/laraclaude:lc:api-docs [all | route-prefix]from laraclaude
Generates API documentation by analyzing Laravel route files, controller methods, form request validation rules, and response structures. Supports filtering by route prefix.
Ships in laraclaude. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Generate API documentation by analyzing route definitions, controller methods, form request validation rules, and response structures.
| Subcommand | Description |
|---|---|
| (no argument) | Generate documentation for all API routes. |
all | Same as no argument -- document all API routes. |
[route-prefix] | Document only routes matching the given prefix (e.g., api/v1/properties). |
This is a generator skill -- it produces documentation output.
Use Read to load routes/api.php and any included route files.
Use Bash to get the full route list from Laravel (if Docker is available):
docker exec {container} php artisan route:list --json --path=api
If Docker is unavailable, parse route files manually to extract:
/api/v1/properties/{property})If a [route-prefix] argument is provided, filter routes to only those matching the prefix.
For each API route, use Read to load the controller and extract:
{property}, {id})$request->query(), $request->input() in GET handlersrules() method$request->validate([...]) inline validation$request->input('field') or $request->only([...]) for expected fieldsFor each validated field, extract:
Analyze the controller method's return statements:
return response()->json($data) -> extract $data structurereturn new JsonResource($model) -> read the resource class's toArray() methodreturn Model::collection($models) -> read the resource collection200, 201, 204, 404, 422)auth:sanctum, auth:api, or custom auth middleware$this->authorize(), Gate::allows()Output structured markdown documentation:
# API Documentation
## Authentication
All API endpoints require authentication via Bearer token (Laravel Sanctum).
Include the token in the `Authorization` header:
Authorization: Bearer {your-api-token}
---
## Properties
### List Properties
`GET /api/v1/properties`
**Query Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| page | integer | No | Page number for pagination |
| per_page | integer | No | Items per page (default: 15) |
| search | string | No | Search by name or reference |
| status | string | No | Filter by status (active, draft, archived) |
**Response (200):**
```json
{
"data": [
{
"id": 1,
"name": "Beach Villa",
"reference": "AB0012",
"status": "active",
"price": 450000,
"created_at": "2026-01-15T10:30:00Z"
}
],
"meta": {
"current_page": 1,
"last_page": 5,
"per_page": 15,
"total": 72
}
}
POST /api/v1/properties
Request Body:
| Field | Type | Required | Rules |
|---|---|---|---|
| name | string | Yes | max:255 |
| address | string | Yes | max:500 |
| price | decimal | Yes | min:0 |
| status | string | No | in:active,draft |
Response (201):
{
"data": {
"id": 73,
"name": "New Property",
"reference": "AB0073",
"status": "draft"
}
}
Error Response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": ["The name field is required."],
"price": ["The price must be at least 0."]
}
}
### Step 4: Include Example Requests
For each endpoint, generate example curl commands:
```bash
# List properties
curl -X GET "https://api.example.com/api/v1/properties?page=1&status=active" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
# Create property
curl -X POST "https://api.example.com/api/v1/properties" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name": "Beach Villa", "address": "123 Coast Rd", "price": 450000}'
Present the full documentation as formatted markdown in the response. If the user wants to save it to a file, offer to write it to a specified location (e.g., docs/api.md), but do not create files unless asked.
JsonResource) are used, read the toArray() method for accurate response structures.$hidden and $visible on the model.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub edulazaro/laraclaude --plugin laraclaude32 skills in this plugin
/lc:analyze-errorPaste a Laravel stacktrace and get root cause analysis with suggested fix./lc:analyze-modelDeep analysis of a Laravel Eloquent model - relationships, scopes, casts, fillable, observers, keepers, actions./lc:blade-auditDetect hardcoded text without @text(), duplicate CSS classes, unused Blade components, and accessibility issues./lc:boost-inspectRuntime-verified Laravel inspection using the Laravel Boost MCP server (Tinker, Database Query/Schema, Last Error) instead of static grep. Falls back to Docker/Tinker if Boost is not installed./lc:cache-opportunitiesDetect repeated queries and computations that should be cached./lc:check-foreign-keysDetect broken, orphaned, or missing foreign key constraints in Laravel migrations and models.Other plugins' skills for the same job