ivory/serializer
ivory/serializer is a lightweight Laravel and PHP package for transforming models and data structures into consistent arrays or JSON. Define serialization rules to control output, simplify API responses, and keep data formatting predictable across your application.
DeserializerInterface rather than depending directly on any community package, so format support is decoupled from vendor choice and swap costs stay low.Consider only as a reference implementation, not a production dependency. It is archived, targets PHP 7.0+, has no dependents, and has no community to absorb security patches or PHP 8+/9 compatibility work. Any Laravel app on a supported PHP version will need to vendor or fork the code — both worse than picking a maintained library.
Consider it when:
Look elsewhere when:
symfony/serializer (broad format + normalization support, actively maintained, Laravel-friendly via spatie/laravel-data or direct container bindings), league/csv for CSV, spatie/array-to-xml/simplexml for XML, and symfony/yaml for YAML.league/csv readers and XMLReader with queued jobs; none of these small libs solve memory-bounded import.Net recommendation: reject as a dependency; mine it for requirements. Record the pattern in an ADR, pick maintained libraries per format, and wrap them in your own interface.
To executives (30-second version): "Multi-format import — CSV, JSON, XML, YAML — is something customers ask for, and it looks strategic but is really plumbing. We evaluated a small open-source library that does exactly this. It's technically neat but archived, unmaintained, and used by nobody, so adopting it would mean owning that code forever to save a few days of work. My recommendation: don't take the dependency. We should still support these formats, but on libraries with active maintenance, behind our own thin interface. That costs us nothing and removes a long-term maintenance risk. The real product question isn't which library — it's which formats to support first and how to package them: CSV and JSON at all tiers, XML as a paid add-on, YAML only if a contract requires it."
To engineering:
ivory/serializer to composer.json. PHP 7.0-era, archived, zero dependents, no path to PHP 8+/9 support; manual wiring since there's no Laravel integration layer.DeserializerInterface, one adapter per format, explicit format detection and error types. Copy the shape, not the code.symfony/serializer for JSON/YAML/XML object mapping, league/csv for streaming CSV, validation at the Laravel form-request layer, imports dispatched to queued jobs with per-row error reporting.To sales/support: "We can support the formats your customers ask for, but we'll roll them out progressively rather than all at once, and we won't ship YAML unless a deal depends on it."
How can I help you explore Laravel packages today?