- How do I install Scribe for Laravel and generate API docs?
- Run `composer require knuckleswtf/scribe` and publish the config with `php artisan vendor:publish --tag=scribe-config`. Then generate docs using `php artisan scribe:generate`. The HTML output will appear in `storage/scribe`.
- Does Scribe work with Laravel 13 and PHP 8.4?
- Yes, Scribe officially supports Laravel 10–13 and PHP 8.1–8.4 as of version 5.8.0. Check the [GitHub releases](https://github.com/knuckleswtf/scribe/releases) for version-specific compatibility notes.
- Can Scribe extract request parameters from FormRequests or validation rules?
- Absolutely. Scribe automatically detects parameters from Laravel’s `FormRequest` classes and validation rules (including custom rules). No extra configuration is needed for standard use cases.
- How does Scribe handle sample responses for API endpoints?
- Scribe can fetch real responses by calling endpoints (with optional mocking) or use Eloquent API Resources/Transformers to generate static samples. For complex cases, you can override responses via custom strategies or static definitions.
- Is there a way to customize the HTML output or branding?
- Yes, publish the default theme with `php artisan vendor:publish --tag=scribe-theme` and modify the CSS/JS in `resources/views/vendor/scribe`. You can also override text, ordering, and examples in the config.
- Does Scribe support OpenAPI 3.1 and Postman collections?
- Yes, Scribe generates both OpenAPI 3.0.3/3.1.0 specs and Postman collections. The specs include security definitions (e.g., for `auth:api` middleware) and support deprecated endpoints with custom annotations.
- What if my API has dynamic routes or non-standard responses (e.g., GraphQL)?
- For dynamic routes, use `php artisan scribe:endpoints:override` to manually define them. For GraphQL or custom responses (e.g., problem+json), extend the `ResponseGenerator` or use static overrides in the config.
- How can I integrate Scribe into CI/CD (e.g., GitHub Actions)?
- Add a step like `php artisan scribe:generate` to your workflow. Publish the docs to a `docs/` folder with `php artisan scribe:publish`. For auto-generation on PRs, use the `--no-examples` flag to skip endpoint calls for speed.
- Are there performance concerns when calling endpoints during generation?
- Calling endpoints can slow down generation, especially for large APIs. Mitigate this by using `--no-examples` to skip live calls or caching responses with `php artisan scribe:cache`. For factories, set `suppress_model_events: true` in config.
- What alternatives to Scribe exist for Laravel API docs, and why choose Scribe?
- Alternatives include Laravel API Docs (lighter but lacks Postman/OpenAPI export) and Swagger PHP (requires manual annotations). Scribe stands out for its zero-config Laravel integration, dynamic response sampling, and extensibility without heavy dependencies.