symfonyboot/symfonyboot-bundle
SymfonyBoot Bundle provides a simple Symfony integration for the SymfonyBoot package, helping you wire configuration and services into Symfony applications with minimal setup. Install via Composer to add lightweight bootstrap support quickly.
^3.0: composer require vendor/package:^3.0. v3 replaces symfony/serializer with jms/serializer; remove Symfony Serializer if it was only present for this package.config/serializer.php or equivalent). v3 config keys follow JMS conventions (cache_dir, metadata, context options), not Symfony Serializer options.use JMS\Serializer\SerializerInterface;
$serializer = app(SerializerInterface::class);
$json = $serializer->serialize($orderDto, 'json');
For the new array-of-objects support:
/** @var array<App\Dto\Order> $orders */
$json = $serializer->serialize($orders, 'json');
The elements must be concrete, serializable objects. Nested arrays still need type metadata (@Type("array<App\Dto\Order>") or attributes) on the property.
#[Type], #[Groups], #[SerializedName], #[Exclude], and #[Since] / #[Until] for API versioning.use JMS\Serializer\SerializationContext;
$json = $serializer->serialize(
$dto,
'json',
SerializationContext::create()->setGroups(['list'])
);
#[Type('array<App\Dto\Order>')]
public array $orders = [];
NormalizerInterface or EncoderInterface; those are no longer used.JsonResponse or a response with Content-Type: application/json. Avoid double-encoding.SerializationContext attributes for runtime flags instead of package-specific globals.JMS\Serializer\Annotation (or attributes).cache_dir. Ensure it is writable, clear it after DTO annotation changes, and warm it during deployment. A stale cache produces confusing “property not found” or missing-field behavior.@Type("array<Fully\Qualified\Class>") on properties and docblocks. For top-level arrays, confirm each element is serializable without context that is only available on a parent object.php artisan config:cache, make sure the JMS cache path is absolute and not inside a path that gets cached incorrectly. Re-run cache clears after changing serializer config.SerializerBuilder directly in Tinker to isolate binding issues, inspect generated metadata in the cache directory, and enable JMS debug options temporarily. For missing fields, check groups, @Exclude, and naming strategy before assuming a package bug.PreSerializeEvent, PostSerializeEvent), naming strategies, and SerializationContext attributes are the supported customization surface in v3. Prefer these over forking the package.symfony/serializer only if another package needs it. JMS Serializer is now a hard dependency and may conflict with packages that expect Symfony Serializer metadata or normalizers.How can I help you explore Laravel packages today?