Downloads
Stars
Version
Convert all your routes and enable named route usage in the front-end.
Compatible with Laravel 6.x, 5.8, and 5.7.
composer require pichicacax/laravel-js-route
Pichicacax\LaravelJsRoute\LaravelJsRouteServiceProvider::class
php artisan route:js
By default, the JS target is resources/assets/js/routes.js. You may change this by providing a custom target
php artisan route:js /path/custom-target.js
import {route} from './routes';
Generate a URL using a named route
route("welcome")
Providing parameters
route("foo.edit", fooId)
route("bar.index", {
param1: value1,
param2: value2
})