- How do I install Scribe for Laravel 13?
- Run `composer require knuckleswtf/scribe` and then execute `php artisan scribe:install`. This sets up the package and config file. Ensure your Laravel app is on PHP 8.1+ and Laravel 10–13 for full compatibility.
- Can Scribe generate API docs for non-standard routes (e.g., legacy or dynamic routes)?
- Yes, Scribe supports static overrides via `scribe.php` config. Define endpoints manually if they’re not auto-detected, including custom route parameters or middleware. This is useful for legacy APIs or complex dynamic routing.
- Will Scribe slow down my production API?
- No, Scribe generates documentation statically—there’s zero runtime overhead. Docs are pre-built and served as static files. You can even disable response calls entirely in `scribe.php` for performance-critical environments.
- How does Scribe handle validation rules in FormRequests?
- Scribe automatically parses validation rules from FormRequests and Laravel’s `validate()` method. It extracts parameter names, types, and rules (e.g., `required|email`) to generate accurate request examples in the docs.
- Can I customize the generated OpenAPI spec or Postman collection?
- Yes, Scribe allows deep customization. Use the `scribe.php` config to override schemas, add examples, or adjust metadata. For advanced needs, extend strategies or use annotations like `#[Deprecated]` to modify behavior.
- Does Scribe support GraphQL or WebSocket APIs?
- No, Scribe is designed for RESTful APIs built with Laravel’s routing system. For GraphQL, consider tools like GraphQL Playground or Apollo Server docs. WebSocket APIs would require custom integration or a wrapper to expose REST-like endpoints.
- How do I integrate Scribe into my CI/CD pipeline?
- Add `php artisan scribe:generate` to your CI script (e.g., GitHub Actions, GitLab CI). Store generated docs in a `public/docs` folder or deploy them to a static host like Netlify. Regenerate docs on every deploy or nightly for consistency.
- What if Scribe misses some validation rules or edge cases?
- Scribe handles most common validation rules, but custom validators or nested arrays might need manual overrides. Use the `validation` strategy in `scribe.php` to refine parsing or add static definitions for unsupported cases.
- Can I use Scribe’s OpenAPI spec to generate client SDKs?
- Absolutely. Export the OpenAPI spec (YAML/JSON) and use tools like OpenAPI Generator to create SDKs for JavaScript, Python, or other languages. Scribe’s spec includes all endpoints, parameters, and responses for seamless SDK generation.
- How do I handle deprecated endpoints in my API docs?
- Use Scribe’s annotations like `#[Deprecated]` in your route or controller code. This marks endpoints in the docs with a warning. For versioned APIs, consider generating separate docs per version or using the `version` config option.