Search by

innoboxrr / routes-to-json

A partir de las rutas del sistema, laravel crea un archivo json en la ubicación especificada en el archivo de configuración para que sean resueltas en el frontend por el paquete route-resolver

Maintainers

Package info

github.com/innoboxrr/routes-to-json

pkg:composer/innoboxrr/routes-to-json

Transparency log

Statistics

Installs: 620

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.6 2026-08-22 18:27 UTC

This package is auto-updated.

Last update: 2026-08-22 18:27:45 UTC


README

Stop hardcoding URLs in your frontend.

Your Laravel routes already have names. This package exports them to a JSON file your JavaScript can read, so the frontend resolves URLs the same way Blade does — by name, not by string.

php artisan routes:json
{
  "user.profile": "/users/{id}/profile",
  "invoice.show": "/invoices/{invoice}"
}

Then resolve them in the browser with the companion package, route-resolver:

route('user.profile', { id: 42 });   // → /users/42/profile

Why it matters

Hardcoded URLs are silent breakage. You rename a route, the backend tests pass, and a button in the SPA quietly 404s in production. Naming the route on both sides makes the rename a compile-time problem instead of a support ticket.

Install

composer require innoboxrr/routes-to-json
php artisan vendor:publish --tag=routes-to-json-config

Configure the output path and which route groups to include, then run the command as part of your build.

Part of Innobox R&R — 52 open-source packages extracted from production work. innobox.systems