darkaonline/l5-swagger).OpenApi\Attributes).Bundle structure; Laravel lacks native bundle support, requiring workarounds (e.g., standalone service providers).routes/web.php/api.php; Nelmio relies on Symfony’s routing.yml or annotations. Would need a custom router integration or annotation-to-route mapping.AnnotationReader. Could use:
doctrine/annotations (legacy) or phpdocumentor/reflection-docblock (modern).HttpKernel (not directly usable in Laravel).PropertyAccess/PropertyInfo (may need polyfills).Annotation component is deprecated; Laravel’s ecosystem leans toward attributes.Illuminate\Routing and Illuminate\Foundation.zircote/swagger-php).darkaonline/l5-swagger (Symfony-based but Laravel-compatible).spatie/laravel-openapi (modern, attribute-driven).spatie/laravel-openapi).swagger-php).doctrine/annotations or PHP 8 attributes to extract docs.spatie/laravel-openapi: Modern, attribute-based, and actively maintained.zircote/swagger-php for static spec generation.swagger-php in GitHub Actions).| Step | Task | Tools/Notes |
|---|---|---|
| 1 | Assess Current Docs | Audit existing API docs (if any) to define scope. |
| 2 | Choose Approach | Decide between: - Option A: Fork Nelmio + adapt to Laravel (high effort). - Option B: Use Nelmio for annotation parsing only + custom OpenAPI generation. - Option C: Migrate to spatie/laravel-openapi (lowest risk). |
| 3 | Set Up Dependencies | Install Nelmio (or alternative) and required polyfills (e.g., doctrine/annotations). |
| 4 | Route Integration | Map Laravel routes to Nelmio’s expected format (e.g., via middleware or service provider). |
| 5 | Annotation Migration | Convert existing PHPDoc/Swagger annotations to Nelmio-compatible format (or use PHP 8 attributes). |
| 6 | Test Generation | Verify OpenAPI spec is generated correctly for a subset of routes. |
| 7 | UI Integration | Serve docs via Swagger UI (darkaonline/l5-swagger can help here). |
| 8 | CI/CD Pipeline | Add doc generation to tests/deployment (e.g., validate spec schema). |
Attribute reflection).symfony/http-kernel, symfony/property-access, etc. Polyfills may be needed for Laravel.composer audit).spatie/laravel-openapi) within 12–18 months.How can I help you explore Laravel packages today?