- How does sunchayn/nimbus help with Laravel API documentation?
- Nimbus generates interactive API schemas dynamically from your Laravel routes and validation rules, eliminating the need for manual documentation. It works alongside Laravel’s built-in validation (FormRequest, Validator) to auto-document endpoints, making it ideal for teams using Sanctum, Passport, or Fortify. The generated schemas can be explored in-browser or exported for tools like Swagger, reducing overhead for API-first projects.
- Can I use nimbus with Laravel 10+ and PHP 8.1+ only?
- Yes, Nimbus is explicitly designed for Laravel 10+ and PHP 8.1+, ensuring compatibility with modern Laravel versions. It avoids hard dependencies on other packages, so you won’t encounter conflicts with tools like Telescope, Horizon, or Laravel’s core components. Always check the package’s changelog for minor version updates, but the core architecture is stable for these requirements.
- Does nimbus support custom validation rules or dynamic validation?
- Nimbus leverages Laravel’s validation system, including custom validation rules and dynamic logic like `Rule::when`. However, overly complex or custom rules may require additional configuration to ensure accurate schema generation. Test edge cases (e.g., conditional validation) in a staging environment before relying on Nimbus for production APIs. The package provides events like `SchemaBuilt` to extend or override schema logic if needed.
- How do I integrate nimbus with Laravel Sanctum or Passport for authentication?
- Nimbus integrates seamlessly with Sanctum, Passport, or Jetstream by respecting Laravel’s auth middleware. You can use `Nimbus::auth()` to align schema visibility with your auth provider, such as hiding admin routes for unauthenticated users. The package doesn’t replace your auth system but ensures API schemas reflect the same access controls. For role-based restrictions, extend the `SchemaBuilt` event to filter routes dynamically.
- Is nimbus suitable for production environments, or just development?
- Nimbus is primarily designed for development and staging environments, where interactive API inspection is valuable. Exposing it in production could inadvertently leak internal API details. For production, use Nimbus to generate static documentation (e.g., Swagger/OpenAPI exports) or restrict access via middleware. Always whitelist routes carefully to avoid security risks.
- How do I customize Nimbus’ UI templates or branding?
- Nimbus provides Blade-based UI templates that you can override by publishing and modifying the package’s views. Use `php artisan vendor:publish --tag=nimbus-views` to copy the templates to your project. Customize colors, layouts, or add your branding while maintaining the core functionality. The package’s extensible design ensures your changes won’t break updates.
- Can nimbus replace Postman or Swagger for API documentation?
- Nimbus is an interactive, developer-focused tool for exploring and debugging APIs, not a full replacement for Postman or Swagger. It excels at auto-generating schemas from Laravel’s validation and routes, making it ideal for internal teams. For external consumers, export Nimbus schemas to OpenAPI/Swagger or use Postman collections alongside it. Nimbus shines in IDE-integrated workflows (e.g., with Laravel IDE Helper).
- What’s the performance impact of using nimbus in a large Laravel app?
- Nimbus has minimal performance overhead because schema generation is cached and only runs during route registration. In large apps, test under load to ensure no delays in API responses. Disable Nimbus in production if not needed for documentation, or use route whitelisting (`Nimbus::routes(['api/*'])`) to limit its scope. The package avoids database or queue dependencies, keeping resource usage low.
- How do I test nimbus in a Laravel project before full deployment?
- Start by enabling Nimbus on a non-critical API module (e.g., `/v1/public`) to validate schema accuracy against existing tools like Postman. Use `Nimbus::ignore(['admin/*'])` to exclude sensitive routes. Test auth integration (e.g., Sanctum role-based access) and custom validation rules in a staging environment. Gradually whitelist routes as you confirm compatibility with your workflow.
- Are there alternatives to nimbus for Laravel API documentation?
- For formal API documentation, consider Swagger/OpenAPI generators like `darkaonline/l5-swagger` or `zircote/swagger-php`. For interactive debugging, Postman or Insomnia remain popular but require manual setup. Nimbus stands out by combining Laravel’s native validation and routing with a developer-friendly UI, reducing the need for external tools. If you prefer minimalism, Laravel’s built-in API resources (e.g., `Route::apiResource`) can structure responses, but Nimbus focuses on request-side documentation.