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
Laravel Xml Converter

Laravel Xml Converter Laravel Package

noki/laravel-xml-converter

A lightweight Laravel package for converting XML to arrays and arrays or objects back to XML. It offers configurable handling for attributes, namespaces, and formatting, making XML integration simple in Laravel apps.

View on GitHub
Deep Wiki
Context7

XML converter package for Laravel

Frequently asked questions about Laravel Xml Converter
How do I install noki/laravel-xml-converter in a Laravel app?
Run composer require noki/laravel-xml-converter. Laravel package auto-discovery should register the service provider and facade; if not, add them manually. Check the package's composer.json for exact Laravel and PHP constraints before installing, and publish any config file only if the README documents one.
Which Laravel and PHP versions does noki/laravel-xml-converter support?
The overview does not state exact Laravel or PHP constraints, so do not assume Laravel 10, 11, or 12 support without checking composer.json. Verify PHP 8.x compatibility and required XML extensions such as dom, simplexml, and libxml. Auto-discovery wiring should also be confirmed in a fresh test app.
How does it handle XML attributes, namespaces, repeated elements, and CDATA?
The package advertises handling for attributes, nested elements, and CDATA, with configurable parsing options. Namespaces and mixed content are the risky edges of any XML-to-array conversion and may not round-trip losslessly. Test a real payload and inspect the exact array shape before relying on it in a compliance or financial feed.
Is noki/laravel-xml-converter safe against XXE and entity expansion attacks?
Do not assume XXE or entity-expansion protection from a thin converter; verify it in the source and configuration. Confirm which backend it uses, such as SimpleXML or DOMDocument, and that external entity loading is disabled. For internet-facing or regulated ingestion, treat this as a hard blocker until proven.
Can it convert XML directly to JSON in Laravel?
Yes. The package is described as converting XML to arrays or JSON in a single call, typically through its Laravel facade. Because JSON is derived from the array representation, attributes, namespaces, and mixed content can inherit the same lossiness. Validate the JSON shape against your actual XML use case.
Does it support large XML files or streaming parsing?
The package appears to be an in-memory converter and does not advertise a streaming path. In-memory parsing can exhaust memory on large or unbounded XML, especially in request paths. For large sitemaps, feeds, or imports, use XMLReader or a streaming design instead.
How should I test it against a real SOAP response or partner payload?
Spike against a real partner or SOAP payload before committing. Wrap the package in an application-owned adapter, then contract-test the boundary for attributes, repeated elements, namespaces, CDATA, and mixed content. A feature-flagged pilot is the right way to confirm behavior without spreading the facade across controllers and jobs.
What are alternatives to noki/laravel-xml-converter?
Consider symfony/serializer, spatie/array-to-xml, or native SimpleXML, DOMDocument, and XMLReader depending on direction and scale. If your app already uses one of those tools, adding this package may only increase dependency surface. Build-versus-buy should be time-boxed against a real payload.
Is noki/laravel-xml-converter production-ready with only 32 stars and one maintainer?
There is little field evidence: the package is described with 32 stars, zero dependents, and a single maintainer. Treat it as medium-risk with low blast radius, and expect to vendor or fork it because MIT licensing makes ownership cheap. Keep it behind an internal interface and monitor releases and test coverage.
How do I configure the XML parsing options in Laravel?
Parsing options are configurable, but the overview does not document every key or default. Check the package config and source to see how attributes, namespaces, CDATA, and formatting are represented. Publish or override config only after confirming the package supports it in your installed version.
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.
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
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console