knuckleswtf/scribe
Generate human-friendly API docs from your Laravel codebase. Scribe outputs a sleek single-page HTML doc with code samples and “Try It Out”, plus Postman collections and OpenAPI specs. It can extract params from validation/FormRequests and auto-generate sample responses.
FormRequest, Route::apiResource, #[BodyParam] attributes) to auto-generate documentation, reducing manual effort.openapi.version) aligns with industry standards.afterExtracting), allowing TPMs to tailor documentation to edge cases (e.g., legacy endpoints, non-standard responses).php artisan scribe:generate). No need to modify existing routes or controllers—it infers endpoints from Laravel’s routing system.symfony/yaml (v8) and parsedown/parsedown (PHP 8.4 compatible) are well-maintained.sometimes, nested arrays) to document request schemas accurately.ignore_endpoints in config or mock responses.ignore_middleware or use afterExtracting hooks to filter endpoints.Rule::unique) may not render perfectly in OpenAPI. Risk: Manual overrides via @property annotations or custom strategies./api/v1/*)? Use ignore_endpoints or route groups./user/profile) be handled? Options: Mock responses, ignore middleware, or use afterExtracting.- name: Generate API Docs
run: php artisan scribe:generate
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
with: publish_dir=storage/scribe
RouteServiceProvider.FormRequest classes and Validator facade.Illuminate\Http\Resources\ApiResource and Spatie\Transformers.auth:api) via config..json collections for direct import.#[BodyParam]).composer require knuckleswtf/scribe
php artisan vendor:publish --provider="Knuckles\Scribe\ScribeServiceProvider"
php artisan scribe:generate
/api/v1/products) to validate:
config/scribe.php:
'base_url' => env('APP_URL'),
'ignore_endpoints' => [
'admin/*',
'health-check',
],
'openapi.version' => '3.1.0', // or '3.0.3'
#[Deprecated] attributes) or hooks (e.g., afterExtracting).main):
php artisan scribe:generate --output=storage/scribe
/api/v1/*)./api/internal/*) with sensitivity controls.spatie/data-transfer-object with its own DTO implementation./users/{user}).morphTo or belongsToMany.problem+json) via content_types.FormRequest classes or Validator facade.#[Deprecated] attributes to mark endpoints.How can I help you explore Laravel packages today?