- How do I install mateusjunges/avro-serde-php in a Laravel application?
- Install it with Composer using composer require mateusjunges/avro-serde-php. The package is framework-agnostic, so Laravel does not need a dedicated service provider or config file from this package. You typically bind a cached Schema Registry client and the Avro serializer/deserializer into Laravel's service container for injection into your Kafka or messaging services.
- Which PHP and Laravel versions does avro-serde-php support?
- The README targets PHP 7.3+ and 8.0, but the v3.1.0 release changes the minimum PHP version to 8.1 and raises core Avro dependencies. Laravel compatibility is driven mainly by the PHP version and Composer dependency graph rather than a Laravel-specific constraint. Teams on PHP 7.3 or 8.0 should pin v3.0.1 unless they upgrade their runtime.
- How do I configure a cached Schema Registry client for Avro SerDe in Laravel?
- The README strongly recommends always using a cached Schema Registry client, because otherwise every serialized or deserialized message can trigger an HTTP request. Configure caching in the Schema Registry client you use, such as FlixTech's schema-registry-php-client or the mateusjunges/confluent-schema-registry-api package where applicable. Then inject that cached client into the Avro serializer and deserializer through Laravel's container.
- Does this package implement the Confluent wire format for Kafka messages?
- Yes. The library implements the Confluent wire format so Avro messages can be written and read in the format expected by Confluent Schema Registry-backed consumers. That wire-format compatibility is the main reason to use this package instead of a generic Avro PHP library. Confirm your Schema Registry client version and serializer configuration match your Kafka pipeline.
- Is v3.1.0 a breaking change for PHP 7.3 or PHP 8.0 applications?
- Yes, in practice v3.1.0 is breaking for PHP 7.3 and PHP 8.0 consumers because it raises the minimum PHP version to 8.1 and increases core Avro dependency constraints. The release is numbered as a minor version, but teams should treat the runtime bump as a breaking change in planning. Pin existing applications to v3.0.1 until the PHP and dependency upgrades are complete.
- How do I use Guzzle 8 with this Avro serializer and Schema Registry client?
- v3.1.0 adds Guzzle 8 compatibility through guzzlehttp/promises ^3.0 and requires mateusjunges/confluent-schema-registry-api 9.1.0 for that path. You need to align Guzzle, promises, the Schema Registry client, and the Avro runtime packages across your Composer dependency graph. Check whether other Laravel packages constrain Guzzle or guzzlehttp/promises before upgrading.
- Can I migrate from flix-tech/avro-serde-php to mateusjunges/avro-serde-php?
- The mateusjunges package is described as a maintained fork with active upstream alignment to flix-tech/avro-serde-php, so migration is plausible but should be validated. Replace the Composer requirement carefully, confirm namespaces and dependency versions, and run contract tests against real Avro payloads and Schema Registry responses. If you are on PHP 7.3 or 8.0, stay on v3.0.1 until the runtime upgrade is done.
- How should I test Avro serialization and deserialization in Laravel before production?
- Write unit tests for serializer and deserializer behavior, then add integration or contract tests that exercise real Avro payloads against a Schema Registry instance. Verify schema evolution cases and Confluent wire-format compatibility rather than only testing happy-path serialization. In Laravel, use your normal test suite and inject a cached or test-specific Schema Registry client to avoid unnecessary network calls.
- What production concerns matter when using Avro SerDe with Schema Registry in PHP?
- Always use a cached Schema Registry client in production to avoid an HTTP request for every message. Monitor Schema Registry availability and schema compatibility policies, and pin Composer dependencies with a rollback lockfile ready. Also validate the full PHP, Guzzle, promises, Avro runtime, and Schema Registry client dependency matrix before rolling out changes.
- Is mateusjunges/avro-serde-php actively maintained, and what alternatives should I consider?
- The assessment points to recent activity, upstream synchronization, PHP 8.4 deprecation fixes, and explicit dependency requirements, which are positive maintenance signals. However, visible adoption is low and release notes do not show a full CI or test matrix, so verify maintenance against your risk tolerance. Alternatives include the upstream flix-tech/avro-serde-php package, other language Confluent clients for Avro-heavy pipelines, or avoiding Avro when PHP is the only runtime in the stack.