goetas/xsd2php
goetas/xsd2php converts XML Schema and WSDL definitions into PHP classes, generating typed models and serialization mappings so you can work with SOAP/XML services in PHP without hand-writing boilerplate. It integrates with JMS Serializer and supports common XSD constructs.
Architecture fit: goetas/xsd2php is not a Laravel-native runtime package; it is a build-time code generator plus a JMS Serializer-based XML binding layer. It fits a Laravel application only when the domain genuinely requires contract-first XML/SOAP integration driven by XSDs. Generated PHP DTOs can sit in app/Integrations/... or a domain namespace and be wrapped by application services, but they will not behave like Eloquent models, form requests, or Laravel resources. The package adds a parallel serialization stack to Laravel’s JSON-centric conventions, so it should be isolated behind adapters rather than exposed directly to controllers.
Integration feasibility: Technically feasible, but with meaningful friction. Generation can be run via CLI in CI or a Composer script, and generated classes can be committed or produced as build artifacts. Runtime integration requires wiring JMS Serializer metadata and possibly doctrine/annotations, which is atypical for Laravel. There is no Laravel service provider, config publishing, or framework integration. The package is best treated as a vendored generation tool with a thin application-owned adapter, not as a normal Composer dependency.
Technical risk: High. The last release was 2016 and the repository is archived, so there are no upstream fixes, no PHP 8.x compatibility guarantees, and no security maintenance. Dependency drift is the primary risk: old jms/serializer, doctrine/annotations, and Symfony Console constraints are likely to conflict with modern Laravel versions and PHP 8.1+. XSD edge cases such as imports, includes, substitution groups, xs:choice, extensions, and namespace handling may generate incomplete or incorrect classes. XML parsing must explicitly disable external entities to avoid XXE. The opportunity score suggests niche usefulness, but the archived status caps strategic value.
Key questions:
Stack fit: Use xsd2php as a development/build dependency where possible, with generated classes checked into a dedicated integration namespace. Keep JMS Serializer usage behind an application-owned XmlGateway or SchemaSerializer service. Bind that service in a Laravel service provider and inject it into jobs, commands, or handlers. Do not let generated DTOs leak into Blade views, API resources, orEloquent relationships. If the generated classes must be used at runtime, pin all transitive dependencies and document the non-Laravel serialization path.
Migration path: Start with a disposable spike branch using one representative XSD. Generate classes, validate round-trip serialization/deserialization against sample payloads, and compare output with the current integration. If the spike passes, introduce the adapter behind a feature flag and run it in parallel with the existing path for at least one release cycle. Keep generated code isolated so it can be replaced. Define an exit strategy: application interfaces should depend on internal DTOs or contracts, not directly on generated classes, so the serializer can be swapped later.
Compatibility: Expect compatibility work. Verify composer why-not against the target Laravel and PHP versions before committing. The 2016 release predates modern PHP, Symfony 5/6/7, and current JMS Serializer major versions. If the project is on PHP 7.4 or older, the package may still run; on PHP 8.1+ it will likely require a fork, dependency overrides, or replacement. Doctrine annotations are deprecated and may be removed in modern stacks. CI should run generation and round-trip tests on the exact supported PHP/Laravel matrix.
Sequencing:
Maintenance: The package is archived, so the team owns the generator, its dependencies, and all generated code. Schema changes become code-generation PRs that require review and regression tests. Dependency upgrades may break generation or serialization. Assign a clear owner and maintain a runbook covering regeneration commands, pinned versions, sample payloads, and rollback steps. Expect generated-code churn in pull requests.
Support: There is no vendor or active upstream support. Community answers will be stale and may reference older PHP/Symfony versions. Internal support requires engineers who understand XSD, XML namespaces, JMS Serializer metadata, and Laravel service wiring. Budget ramp-up time and create internal documentation; otherwise on-call triage for XML failures will be slow.
Scaling: Generation is build-time, so runtime scaling is mostly about XML document size and serializer memory/CPU. Large documents may be loaded fully into memory; high-volume ingestion should run in queued jobs with timeouts and memory limits. Generated class count can grow significantly with large schemas, though opcache and Composer autoloading mitigate this. This package is not a good fit for very large XML streams or high-throughput APIs without additional streaming or chunking design.
Failure modes:
Ramp-up: Moderate for a PHP developer, high for a team without XML schema experience. Engineers need familiarity with XSD imports/includes, XML namespaces, JMS Serializer annotations or metadata, and Laravel service-container wiring. A one-to-two-week spike is appropriate to validate compatibility and round-trip behavior before committing to production use. If the team cannot absorb generator ownership, the correct TPM recommendation is to avoid this package and evaluate a maintained alternative.
How can I help you explore Laravel packages today?