- Can I use pedrotroller/api-doc in a Laravel application?
- No. pedrotroller/api-doc is a Symfony bundle that extends NelmioApiDocBundle v2.x and depends on Symfony's DI container, event dispatcher, and Translation component, none of which map onto Laravel's architecture. Its legacy Composer constraints conflict with PHP 8.x, Symfony 5+, and Laravel 9–12. For Laravel, re-implement the translation-decorator pattern using Scramble, Scribe, L5-Swagger, or zircote/swagger-php instead of installing this package.
- What does pedrotroller/api-doc actually do?
- It adds translation support to API documentation generated by NelmioApiDoc by hooking into Nelmio's annotation-driven extractor pipeline and Symfony's translator service. The result is localized summary and description fields emitted into generated API docs. It is a thin set of decorators and wrappers, and it only works with legacy Symfony applications running NelmioApiDocBundle v2.x.
- How do I install pedrotroller/api-doc?
- You can only install it via Composer in a legacy Symfony 2.8 or 3.x application that already uses NelmioApiDocBundle ^2.x. There is no Laravel service provider, facade, or configuration file, and the package's PHP and Symfony constraints will not resolve on modern Laravel or Symfony stacks. The practical recommendation is not to install it and instead port its small decorator pattern to your current doc generator.
- Is pedrotroller/api-doc compatible with Laravel 9, 10, 11, or 12?
- No. The package is pinned to legacy constraints such as PHP ^5.5|^7.0, Symfony ^2.3|^3.0, and nelmio/api-doc-bundle ^2.x, which directly conflict with Laravel 9–12 requirements. Laravel 9 and later require PHP 8.0+ and modern Symfony components, and there is no bridge or adapter in this package. Attempting to install it in a Laravel project will produce Composer dependency conflicts.
- Does pedrotroller/api-doc support PHP 8 or Symfony 6 and 7?
- No. The package was last released in 2016 and targets PHP 5.5/7.0 and Symfony 2.3/3.0. NelmioApiDocBundle v3 and later replaced the annotation extractor with swagger-php, removing the extension points this package relies on. On modern Symfony, the equivalent approach is to upgrade to NelmioApiDocBundle v4 or v5 and decorate the relevant Describer services with a translator-aware wrapper.
- How do I add localized API documentation in Laravel without this package?
- Use your existing Laravel doc generator, such as Scramble, Scribe, L5-Swagger, or zircote/swagger-php, and post-process the generated OpenAPI JSON. A small service can walk paths.*.description and summary fields and substitute values from lang/{locale}/api.php or your translation store. Alternatively, use the documentation hooks provided by Scramble or Scribe to inject locale-aware descriptions during generation.
- What are the best alternatives to pedrotroller/api-doc for Laravel developers?
- For Laravel, the practical alternatives are Scramble, Scribe, L5-Swagger, and zircote/swagger-php, combined with a locale-aware post-processing step or generator hooks. For modern Symfony, use NelmioApiDocBundle v4 or v5 with a custom translator-aware Describer or ModelDescriber decorator. In both cases you are re-implementing the same conceptual pattern against a supported upstream rather than adopting this abandoned package.
- Is pedrotroller/api-doc maintained and safe for production use?
- No. The last release was 2016-06-08, it has a single maintainer, zero dependents, one star, no CI, no issue triage, and no security disclosure process. It is effectively a personal utility rather than a supported library. Adopting it for new production work carries high abandonment and version-skew risk, and it is only defensible as a pinned, vendored dependency in a legacy Symfony application with a scheduled migration.
- What are the main technical risks of adopting pedrotroller/api-doc?
- The main risks are abandonment, an end-of-life upstream dependency on NelmioApiDocBundle v2.x, and Composer version skew against PHP 8.x, Symfony 5+/6+/7, and current Laravel releases. There is also no maintenance or security posture, so bugs and vulnerabilities will not be addressed. If you must use it in a legacy Symfony app, vendor-fork it into your repository and plan to migrate off it.
- How does pedrotroller/api-doc handle configuration and translation?
- It integrates through Symfony bundle configuration and dependency injection, hooking into Nelmio's annotation-driven extractor pipeline and Symfony's translator service. That lets it emit localized description and summary fields into generated API documentation based on Symfony's translation catalogs. It does not integrate with Laravel's localization helpers, lang files, or service container, so Laravel teams must implement equivalent behavior in their own doc pipeline.