laminas/laminas-serializer
Serialize and deserialize PHP data using multiple adapters (e.g., PHP native, JSON, XML, WDDX) with consistent options, error handling, and extensibility. Useful for caching, sessions, message payloads, and storage across different formats.
The AdapterPluginManager extends the laminas-servicemanager AbstractPluginManager, and has the following behaviors:
Laminas\Serializer\Adapter\AdapterInterface instances.get().Laminas\Serializer\AdapterPluginManager is mapped to the factory.
Laminas\Serializer\AdapterPluginManagerFactory when wired to the dependency injection container.
The factory will be automatically registered when loading/installing the Laminas\Serializer module in laminas-mvc and/or loading/installing the ConfigProvider into a Mezzio application.
Since version 2.10.0, the factory will look for the config service, and use the serializers configuration key to seed it with additional services.
This configuration key should map to an array that follows standard laminas-servicemanager configuration.
To add your own serializer you can add the following configuration:
// config/autoload/serializers.global.php
return [
'serializers' => [
'factories' => [
\App\MyCustomSerializer::class => \App\Container\MyCustomSerializerFactory::class,
],
],
];
How can I help you explore Laravel packages today?