- What does mcfedr/uuid-paramconverter do?
- It is a Symfony bundle that registers a param converter for ramsey/uuid. It converts a UUID route parameter into a Ramsey UUID object so controller arguments are typed UUID instances instead of raw strings. It also includes a Symfony Serializer normalizer and a Symfony Form type for UUID values.
- Is mcfedr/uuid-paramconverter a Laravel package?
- No. It is built specifically for Symfony and depends on Symfony-specific extension points such as ParamConverter, Symfony Serializer, and Symfony Forms. It has no native integration with Laravel's request lifecycle.
- Can I use mcfedr/uuid-paramconverter in a Laravel application?
- Not realistically. Laravel does not ship Symfony's ParamConverter, Symfony Serializer, or Symfony Forms by default, so the package's core features do not fit. In Laravel, reproduce the behavior with Route Model Binding, custom Eloquent casts, validation rules, and API Resources.
- How do I install and register mcfedr/uuid-paramconverter?
- Install it with Composer and enable the bundle in your Symfony application's bundle configuration. You also need ramsey/uuid and, for the param converter behavior, SensioFrameworkExtraBundle in versions where that bundle still provides controller argument conversion. There is no Laravel service provider or configuration to register.
- Which Symfony versions support the UUID param converter?
- It targets older Symfony releases, roughly the Symfony 4 and 5 era, where SensioFrameworkExtraBundle's ParamConverter was the normal approach. ParamConverter usage was deprecated in Symfony 6.2, and the underlying mechanism is not available in Symfony 7. Treat the package as a legacy Symfony dependency rather than a forward-compatible one.
- Does mcfedr/uuid-paramconverter work with ramsey/uuid v4?
- Probably not without conflict. The package was last released in January 2022 and is pinned to older Symfony and Ramsey UUID ranges, so current ramsey/uuid majors may not resolve. Run composer why-not against your target versions before attempting an upgrade.
- How do I convert UUID route parameters to UUID objects in Laravel?
- Use Laravel's native routing features instead. A Route::bind closure can call Uuid::fromString() on the route value and return a 404 when InvalidUuidStringException is thrown, or you can type-hint a UUID-backed model and resolve it by its UUID column. This gives you typed controller arguments without Symfony dependencies.
- How do I serialize Ramsey UUIDs to strings in Laravel JSON responses?
- Add a custom Eloquent cast that converts the stored string to a Ramsey UUID object and back to a string on save. For responses, format the value in an API Resource or JsonResource so the UUID is emitted as a plain string. Laravel does not use Symfony Serializer normalizers by default.
- What are the Laravel alternatives to this UUID param converter package?
- For Laravel, the alternatives are built in: Route Model Binding or Route::bind for route parameters, custom casts for model attributes, Rule::uuid or a custom Uuid::isValid rule for validation, and API Resources for output. These cover the same use cases with no third-party package and full control over error behavior.
- Is mcfedr/uuid-paramconverter maintained and safe for production?
- Treat it as low-maintenance and effectively orphaned: it has a single maintainer, few stars, no dependents, and its last release was January 2022. More importantly, its core ParamConverter value proposition is tied to a deprecated Symfony contract. For Laravel, do not adopt it; for Symfony, use it only as an isolated stopgap with an exit plan.