lord/laroute
LaRoute exposes your Laravel named routes to JavaScript, letting you generate URLs client-side with a route() helper that mirrors Laravel's API. It supports route parameters, filtering, and easy integration so frontend code stays in sync with backend routes.
route() output into a <script> tag, plus a JS wrapper to interpolate parameters. That is roughly 100–200 lines of glue plus ongoing maintenance every Laravel upgrade. Laroute makes the buy decision concrete and cheap to reverse, since it is a single MIT-licensed dependency./admin/users/ + id string concatenation scattered across JS. This package underwrites a cleanup backlog item — measure it by counting string-literal URL occurrences in JS before and after.Adoption criteria — pick it up when most of these are true:
Look elsewhere when:
To executives: This is a small MIT-licensed utility that stops front-end code from hardcoding URLs. The business case is bug prevention and reduced coordination cost — when a route path changes, links in JavaScript break silently and surface as 404s in production. Centralizing route definitions on the server removes that class of defect for roughly the cost of one small integration ticket. It has no licensing cost and no vendor exposure. The caveat to state plainly: it is a lightly maintained package with a 2023 release, so the honest recommendation is to adopt route sharing as a practice and treat the specific library choice as an open question pending a maintenance check.
To engineering: The value is a single source of truth for named routes — PHP and JS resolve the same names with the same parameters, including tenant prefixes and locales that a static manifest cannot handle. The cost is a service provider registration and a small script include; the API is a route() call that mirrors Laravel's. Two asks before committing: confirm compatibility with our current Laravel version, and benchmark against Ziggy, which has stronger community support and a more active release cadence. If we standardize, we should standardize deliberately rather than defaulting to whichever package the first JS feature happens to pull in — swapping later means touching every call site.
How can I help you explore Laravel packages today?