bmatovu/laravel-xml
A Laravel package for working with XML. It converts XML requests and responses into arrays, adds XML response helpers and middleware, and lets your APIs accept and return XML alongside JSON, with configurable parsing and validation support.
Verdict up front: v4.2.0 is a maintenance release with a breaking platform-support cut — not a feature release. It materially improves the two things we flagged as unknowns (maintainer activity and Laravel-major tracking) and simultaneously hardens the one thing we flagged as a coupling risk (our Laravel upgrade cadence is now the package's upgrade cadence). Net: the verdict is unchanged — thin, low-risk serialization utility, narrow use case, keep it wrapped and pinned — but the pinning discipline is now mandatory rather than good practice.
What changed in v4.2.0. Dropped Laravel 10/11 and PHP 8.1; added Laravel 13; CI workflow modernization; Node.js 24 for tooling. Interpretation:
4.1.x → 4.2.0 removes platform support. Under a caret constraint (^4.1), any routine composer update or bot-driven bump silently drops Laravel 10/11 and PHP 8.1 support out from under an application still on those versions. This is a semver-hygiene problem and the practical risk it creates is a green-CI deploy that fails at runtime, or worse, resolves to a version that installs but is untested against our stack.Architecture fit. Unchanged. A Laravel service provider adding XML response capability at the transport/presentation edge (macro/helper plus configuration) over an array-to-XML serializer. It does not touch routing, auth, Eloquent, queues, or domain code, and it is opt-in per route rather than a global middleware hijack. Still enforce the design constraint: XML must not leak into controllers as response()->xml($model->toArray()). Serialize from an internal responder/presenter with explicit field allow-listing, so the vendor surface stays at two or three call sites and the serialization boundary is owned by us, not by the package.
Real use cases it plausibly serves: legacy B2B partner endpoints that only speak XML, sitemaps and RSS/Atom feeds, UBL/Factur-X or ISO 20022-style envelopes (package handles the envelope, not the schema), and SOAP-adjacent HTTP integrations. Still a poor fit for high-volume customer-facing APIs where XML is a checkbox.
Integration feasibility. High, with one new precondition: we must be on a Laravel version the release targets (v4.2.0 supports the Laravel 13 line and drops 10/11; PHP floor moves to 8.2 — confirm the exact constraint range from composer.json rather than reading the changelog). If we are on Laravel 10 or 11, v4.2.0 is not available to us and we are pinned to an unmaintained 4.1.x branch. Spike remains half a day; wrapped, contract-tested integration remains one to two weeks including partner payload reconciliation.
Technical risk.
4.2.0), lock file committed, and an explicit exemption for this package from auto-merge minor-bump bots.Key questions for the maintainer/repo.
composer.json (Laravel majors, PHP floor/ceiling) for v4.2.0? Read the constraint, don't infer from the changelog.Accept-header content negotiation, or explicit XML routes only? (Prefer explicit.)Stack fit. Clean on Laravel 12/13 with PHP 8.2+. No infrastructure, runtime, or deployment change — it ships in the application artifact like any other Composer dependency. It coexists with Eloquent API Resources provided JSON and XML representations are generated from a shared presenter rather than duplicated in controllers. If we are still on Laravel 10/11 for any service, this package version is off the table for that service until the framework upgrade lands.
Buy vs. build. Unchanged. Roughly a few hundred lines of glue over an existing serializer; in-house remains legitimate and removes the vendor relationship. Use the package as a reference implementation and fast spike, then decide explicitly whether to depend or absorb. The v4.2.0 drop cadence is a mild argument for absorbing: an in-house implementation has no forced-upgrade schedule. That is a real but not yet decisive data point — the code volume is small either way, and the fork path stays a one-day exercise.
Migration path. Do not migrate existing JSON endpoints. XML is additive, introduced only for consumers that require it — separate route prefix or negotiated Accept, behind a feature flag, wrapped so a swap to fork or in-house is a single-file change.
Compatibility work and sequencing (revised for v4.2.0).
composer.json on the tag. Record the exact Laravel and PHP constraints for 4.1.x and 4.2.0 into our dependency manifest. This replaces guesswork from the changelog.4.2.0, lock file committed, bot auto-merge disabled for this package. On Laravel 10/11: pin the last compatible 4.1.x, log it as an accepted unsupported dependency, and tie its removal to the framework upgrade ticket.XmlResponder interface, explicit field allow-listing, config for namespaces and root element.Content-Type and charset exactness (text/xml vs application/xml has broken more integrations than any serialization bug), auth unchanged, no model auto-serialization, response size sanity check.Maintenance. Low churn, but the nature of it changed. Previously the risk was "the maintainer may lag a Laravel major"; now it is "the maintainer will drop a Laravel major, on the framework's EOL schedule, in a minor release." That is more predictable and more manageable — but only if our Laravel upgrade cadence keeps pace. Budget one to two days per Laravel major to validate or patch, and treat the package version as part of the framework upgrade checklist rather than a separate line item. Assign a named code owner in the dependency manifest and record the exact-pin rationale so a future engineer doesn't "helpfully" relax it to a caret.
Support. No vendor, no SLA, no escalation path — public issues only. Internal supportability rests on our own documentation: a runbook covering how XML responses are generated, where config lives, how to add a new XML endpoint, how to fork, and — new in this release — the supported-version matrix and the pin policy. Weekend-scale effort, non-negotiable given the adoption profile.
Scaling. Unchanged and unrelated to this release. XML serialization is materially more expensive than JSON: DOM construction is CPU- and memory-heavy and payloads run two to five times larger on the wire, affecting bandwidth, gzip CPU, and client parse time. Irrelevant at partner-integration volumes (hundreds to low thousands of requests/hour). Wrong tool for high-volume or high-cardinality endpoints: cache sitemaps and feeds at the edge, cap payload sizes, keep XML off hot paths. The serialization cost, not the package, is the limiting factor.
Failure modes to watch.
Observability and detection. Assert Content-Type and validate a sample payload in CI; log schema-validation failures separately from application errors so partner-driven 4xx spikes are attributable; monitor error rate and latency per partner endpoint rather than in aggregate. Add a CI check that resolves and reports the installed package version per service, so an unexpected bump is visible before deploy.
Ramp-up. Hours to productivity for a competent Laravel engineer; about a day to understand the internals fully. The genuine cost sits outside the code: XML schema literacy, partner sample reconciliation, and external certification cycles running days to weeks on someone else's clock. Plan the roadmap around the partner's timeline. Treat v4.2.0 as confirmation that this dependency is healthy but on a schedule we do not control — keep it deliberately peripheral, wrapped, exact-pinned, and replaceable.
How can I help you explore Laravel packages today?