Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Xsd2Php Laravel Package

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.

Deep Wiki
Context7

Technical Evaluation

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:

  • Which XSDs are in scope, who owns them, and how often do they change?
  • Is XML/SOAP a strategic integration or a legacy bridge with a planned exit?
  • Which Laravel and PHP versions must be supported now and in the next 12–18 months?
  • Do we need full round-trip fidelity, or only deserialization into internal DTOs?
  • Can the team fork and maintain the generator if PHP/Laravel upgrades block upstream dependencies?
  • What are the XML security, size, and throughput requirements?
  • Is a modern alternative viable, such as a maintained fork, Jane PHP, Symfony Serializer with custom normalizers, or hand-written DTOs with a focused XML mapper?

Integration Approach

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:

  1. Confirm schema ownership, change cadence, XML security requirements, and volume expectations.
  2. Run a time-boxed Composer/PHP compatibility spike against the current Laravel version.
  3. Generate classes from a representative XSD and test imports, namespaces, optional fields, dates, decimals, and choice constructs.
  4. Build an application-owned serializer adapter with contract tests and XXE protection.
  5. Integrate one low-risk endpoint or queue job behind a feature flag.
  6. Add CI checks that regenerate and diff generated classes.
  7. Document regeneration, dependency pinning, and fork ownership.
  8. Decide within one sprint whether to adopt, fork, or replace.

Operational Impact

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:

  • Composer dependency conflicts block Laravel or PHP upgrades.
  • PHP 8+ incompatibility or removed dependencies cause runtime failures.
  • Unsupported XSD constructs generate incorrect or incomplete classes.
  • Namespace, date, decimal, and optional-field mismatches corrupt payloads.
  • XML external entity vulnerabilities if parsing is not hardened.
  • Serializer metadata cache issues after deployment or schema changes.
  • Backward-incompatible XSD changes break consumers without versioned contracts.
  • Generated code drifts from committed artifacts if CI regeneration is skipped.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core