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

Ux Router Laravel Package

symfony/ux-router

Symfony UX Router brings Symfony routing to JavaScript, letting you generate URLs from route names and parameters, match current routes, and navigate client-side. It integrates with Turbo and Stimulus to eliminate hardcoded URLs in dynamic Symfony apps.

View on GitHub
Deep Wiki
Context7

Exposes Symfony Routes directly to JavaScript.

Frequently asked questions about Ux Router
Is symfony/ux-router a Laravel package?
No. It is a Symfony UX component that assumes Symfony's routing layer and container build lifecycle, and it ships no Laravel service provider, facade, Blade directive, or publishable config. On a Laravel codebase the closest native equivalent is Ziggy. Treat symfony/ux-router as adoptable only in a Symfony or mixed estate where Symfony owns the routing and front end.
Does symfony/ux-router work with Laravel?
Not without a bridge you would have to build and maintain yourself. The package exposes Symfony route definitions to JavaScript and is coupled to Symfony's router and container compilation, so it does not drop into Laravel's routing stack. For Laravel applications, evaluate Ziggy instead, which already occupies this niche and is Laravel-native. A custom bridge is possible in theory but adds ownership cost with little upside.
What is the Laravel equivalent of symfony/ux-router?
Ziggy is the Laravel-native package for exposing server-side routes to JavaScript. It lets front-end code generate URLs from route names and parameters, much like symfony/ux-router does for Symfony. If you are evaluating this package because you want named-route URL generation in a Laravel app, Ziggy is the direct comparison. symfony/ux-router itself is not a Laravel package.
What does symfony/ux-router do?
It exposes Symfony route definitions directly to JavaScript so front-end code can generate URLs from route names and parameters instead of hard-coding paths. It can also match the current route and support client-side navigation. It integrates with Turbo and Stimulus to reduce hardcoded URLs in dynamic Symfony apps. The package is deliberately thin and sits on top of Symfony's router rather than replacing it.
How do I install symfony/ux-router in a Symfony app?
Install it with Composer, enable the UX Router bundle, dump routes during the build, and consume the generated JavaScript in your front end. There is no database schema or persistence layer, and it does not add a runtime service dependency in the request path. The main setup decision is where route dumping happens and whether the dump directory is writable in that environment. Check the package README for the exact Flex recipe and bundle registration steps.
Which Symfony versions does symfony/ux-router support?
The technical evaluation positions it for Symfony 6.4 and 7.x with a UX front end such as Twig plus AssetMapper or Encore. Because UX packages version in lockstep with the Symfony UX monorepo, the 3.x major number overstates the package's own maturity. Verify the current compatibility range on Packagist before committing. The package was newly introduced in the UX monorepo, so treat its JavaScript-facing API as unstable for at least a couple of minor cycles.
Does symfony/ux-router support localized routes?
Yes. Version 3.6.0 added a fallback to the application default locale, so localized route generation degrades to the default locale instead of producing nothing or erroring when no locale is supplied. That removes a class of i18n edge-case defects. Before relying on it, confirm the fallback matches your intended canonical and SEO behavior across every live locale.
Why does route dumping fail during a Symfony container build?
The route dump is coupled to container compilation, so it fails if the dump directory is absent or not writable at build time. Version 3.6.0 includes a fix for dumping routes when the container is built without a dump directory, but teams still need to decide whether dumping happens in a build stage or at container boot. Read-only or slim production images are the common failure case. Make the dump path explicit and writable in whatever stage performs the container build.
Is symfony/ux-router stable enough for production?
It is newly introduced in the Symfony UX monorepo, so the JavaScript-facing API should be treated as unstable for at least a couple of minor cycles. The 3.x version number reflects monorepo lockstep versioning, not the package's own maturity. Technical risk is otherwise contained: there is no data, auth surface, or network call, and the worst case is broken links rather than broken transactions. Pin versions and review changelogs before upgrading.
What are the maintenance risks of using route names as a JavaScript contract?
Once JavaScript calls routes by name, route names become a cross-language contract. Renaming a Symfony route silently breaks JS callers with no compile-time signal, which is a genuine long-term maintenance tax rather than a one-off setup cost. You need an owner for route naming as a public contract and a process for renaming routes safely. Build-time route dumping also means one bad route definition can block every build in a monorepo or multi-tenant setup.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons