Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Uuid Paramconverter

Uuid Paramconverter Laravel Package

mcfedr/uuid-paramconverter

Symfony param converter that turns UUID route parameters into Ramsey UUID objects before they reach your controllers. Type-hint UuidInterface and malformed or missing UUIDs are rejected automatically, with no manual parsing or validation boilerplate.

View on GitHub
Deep Wiki
Context7

mcfedr/uuid-paramconverter adds UUID route parameter conversion to Laravel, letting you bind UUID-based route segments directly to Eloquent models. Instead of manually querying by UUID in every controller, you can define routes with UUID placeholders and have the correct model instance injected automatically.

It helps when your application uses UUID primary keys rather than auto-incrementing integers, keeping route model binding clean and consistent.

  • Bind UUID route parameters to Eloquent models automatically
  • Works with UUID primary keys and custom UUID columns
  • Keeps controllers free of repetitive lookup logic
  • Simple drop-in integration with Laravel routing
  • Configurable resolution for custom models and behaviour
Frequently asked questions about Uuid Paramconverter
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.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections