creads/api2symfony
Converts API Platform endpoints into Symfony-friendly client code from your OpenAPI/Swagger spec. Generates models and request classes to speed up integration with API Platform services and keep your Symfony app’s API clients consistent and maintainable.
routes/web.php) and dependency injection (e.g., Symfony’s DI vs. Laravel’s container).HttpKernel or a micro-framework like api-platform).Route::apiResource()) is incompatible with Symfony’s YamlRouteLoader.artisan api:generate).symfony/validator + symfony/serializer as Composer dependencies).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Deprecated Dependencies | High | Audit Symfony version compatibility; replace with modern alternatives (e.g., nelmio/api-doc-bundle for OpenAPI). |
| Laravel-Symfony Friction | High | Abstract Symfony-specific logic into a service layer or use Symfony’s HttpKernel as a microservice. |
| Regeneration Overhead | Medium | Implement a custom generator (e.g., PHP scripts) to translate Symfony stubs to Laravel. |
| Testing Complexity | Medium | Write integration tests for generated code; mock Symfony components where needed. |
| Maintenance Burden | High | Plan for forking/extending the package or replacing it with a Laravel-native tool (e.g., darkaonline/l5-swagger). |
zircote/swagger-php or darkaonline/l5-swagger.Validator via Composer but generate Laravel-compatible controllers.spatie/laravel-openapi or php-openapi/validator for alternatives.Controller classes.HttpKernel as a standalone service (e.g., via symfony/http-kernel).Validator/Serializer with Laravel’s Illuminate\Validation and Illuminate\Support\Collection (or spatie/array-to-object).HttpClient (if container-compatible).zircote/swagger-php for validation or darkaonline/l5-swagger for Laravel-native docs.HttpKernel as a microservice (e.g., via Docker or separate repo).creads/api2symfony to output Laravel-compatible code (e.g., using Laravel’s make:controller templates).swagger.yaml changes).| Component | Symfony Support | Laravel Workaround |
|---|---|---|
| Controllers | ✅ Bundle-based | Manually adapt to Laravel’s Controller classes or use HttpKernel as a service. |
| Routes | ✅ YAML/XML | Replace with Laravel’s Route::apiResource() or custom RouteServiceProvider. |
| DTOs | ✅ Symfony Classes | Use Laravel’s Illuminate\Support\Collection or spatie/array-to-object. |
| Validation | ✅ Validator | Replace with Laravel’s Validator or symfony/validator as a Composer dependency. |
| Serialization | ✅ Serializer | Use spatie/laravel-array-to-object or jenssegers/date for custom serialization. |
| API Clients | ✅ Typed | Reuse in Laravel via Guzzle/PSR-18 or Symfony’s HttpClient. |
| Authentication | ✅ Guard/Bundle | Adapt to Laravel’s Auth or sanctum/passport. |
HttpClient.laravel-shift or roave/security-advisories for dependency checks.How can I help you explore Laravel packages today?