knuckleswtf/scribe
Scribe generates human-friendly API docs from your Laravel code. It builds a polished single-page HTML site with code samples and “Try It Out”, plus Postman collections and OpenAPI specs. It can infer params from validation and fetch sample responses.
FormRequest, API Resources, Transformers) to generate documentation, making it a first-class citizen in Laravel ecosystems.problem+json) and deprecated endpoints, aligning with API design best practices.#[Deprecated], #[BodyParam]).knuckleswtf/scribe) with zero runtime overhead (docs are pre-generated). No changes to existing API logic required.| Risk Area | Mitigation Strategy |
|---|---|
| Endpoint Dependency | Opt-in response generation (configurable via scribe.php). Can mock responses instead. |
| Validation Parsing | Handles edge cases (e.g., sometimes rules, nested arrays) but may miss custom validators. |
| Performance | Generates docs statically (no runtime impact). Large APIs may require optimization (e.g., parallel processing). |
| Breaking Changes | Major versions (e.g., v5.0.0) include migration guides. Backward-compatible by default. |
| Custom Logic | Extensible via strategies, but complex overrides may require PHP expertise. |
routes/api.php), controllers, or resource classes.composer require knuckleswtf/scribe
php artisan scribe:install
/api/v1/users).scribe.php (e.g., disable response calls for unstable endpoints).main branch pushes./docs route.config/scribe.php.| Component | Compatibility Notes |
|---|---|
| Laravel Routes | Supports all route types (GET, POST, etc.) and middleware. |
| Validation | Parses FormRequest and Validator rules (including sometimes, nested arrays). |
| API Resources | Extracts fields from Illuminate\Http\Resources\ApiResource. |
| Transformers | Works with League\Fractal transformers. |
| Authentication | Auto-detects auth:api middleware; supports custom security schemes in OpenAPI. |
| Testing | Can generate docs from test routes (useful for internal APIs). |
php artisan scribe:generate in a clean environment (avoid cached responses).--no-response-calls for initial pass to avoid runtime issues.Cache-Control: max-age=86400) for performance.APP_VERSION to track doc iterations.intro_text in config).@deprecated annotations.ignored_routes in config.response_calls or mock data.sometimes).php artisan scribe:debug to inspect parsed routes.verbose mode in config for detailed logs.#[Deprecated]).--parallel flag for faster generation.ignored_routes.response_calls for non-critical paths./docs route: Serve via public/docs folder.parallel in scribe.php).| Scenario | Mitigation |
|---|---|
| Broken Endpoints | Disable response_calls or use mock responses. |
| Validation Parsing Errors | Override rules via |
How can I help you explore Laravel packages today?