PHPackages                             delormejonathan/laravel-js-routing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. delormejonathan/laravel-js-routing

ActiveLibrary

delormejonathan/laravel-js-routing
==================================

Laravel 4/5 package to access Routing from Javascript

v2.0.2(9y ago)71.0k3MITPHPPHP &gt;=5.4.0

Since Sep 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/delormejonathan/laravel-js-routing)[ Packagist](https://packagist.org/packages/delormejonathan/laravel-js-routing)[ RSS](/packages/delormejonathan-laravel-js-routing/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (10)Used By (0)

Javascript Routing for Laravel 4/5
==================================

[](#javascript-routing-for-laravel-45)

This package allows you to access Laravel's routing from your Javascript.

The main feature is the possibility to use it easily in local and production environment.

In local environment, the JS routes are re-written each request. In production environment, the JS routes are dumped in a static file for better performance.

If you're using Laravel 4, please read this documentation : [Laravel 4 README](https://github.com/delormejonathan/laravel-js-routing/tree/5fcf8e1aac3c36c14262191452451565717738f1)

Installation
------------

[](#installation)

Add this line to your **composer.json** and run `composer update`

```
"delormejonathan/laravel-js-routing": "~2.0"

```

Add the provider to **app.php** to the **providers** section

```
DelormeJonathan\LaravelJsRouting\LaravelJsRoutingServiceProvider::class,

```

Add the facade to **app.php** to the **aliases** section

```
'JSRouter' => DelormeJonathan\LaravelJsRouting\Facades\JSRouter::class,

```

Publish assets to public folder

```
php artisan vendor:publish --tag=public --force

```

Usage
-----

[](#usage)

Call the JSRouter plugin in your application template :

```

```

And import routes file dynamically in local and statically in production :

```
@if (App::environment() == 'production')

@else
	{!! JSRouter::generate() !!}
@endif
```

Now, you can use it in JavaScript :

```
JSRouter.action('UsersController@edit', { id : 5 }); // For routes without a name
JSRouter.route('mycustomroutename'); // For routes with a name
```

Don't forget to export routes in production. You can add a custom path right after the 'dump' word. Default path is : public/js/routes.js

```
php artisan laravel-js-routing:dump
```

```
php artisan laravel-js-routing:dump public/mycustompath/mycustomfile.js
```

Configuration
-------------

[](#configuration)

You can change the default path with the configuration file. You have to publish the config file :

```
php artisan config:publish delormejonathan/laravel-js-routing
```

Then modify it in app/config/packages.

Common issues
-------------

[](#common-issues)

**Browser console report "No routes detected"**

Make sure you have at least one route with a name or a controller in your routes.php.

**I added a route to Laravel and the JSRouter doesn't see it**

If you are in production environment, remember to export your routes with *php artisan laravel-js-routing:dump* when you change your routes.php

If you are in local environment, remember that your route needs to point to a controller. It can have a name (optional). This package doesn't work with Closure routes.

Contribution &amp; improvements
-------------------------------

[](#contribution--improvements)

The plugin is pretty basic currently. He needs a better parsing engine to manage optional parameters.

Issues or features
------------------

[](#issues-or-features)

Feel free to open an issue if you encounter a problem or contact me directly.

Credits
-------

[](#credits)

- [FOSJsRoutingBundle](https://github.com/FriendsOfSymfony/FOSJsRoutingBundle) for the inspiration.

License
-------

[](#license)

This project is licensed under the MIT license.

###  Health Score

33

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~113 days

Recently: every ~222 days

Total

9

Last Release

3310d ago

Major Versions

v1.0.5 → v2.0.02016-09-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/b08cb14d549f8088f46747859b9c2e4de7c3e0b4114a2bc429cf0e22c035c3ec?d=identicon)[delormejonathan](/maintainers/delormejonathan)

---

Top Contributors

[![delormejonathan](https://avatars.githubusercontent.com/u/5949870?v=4)](https://github.com/delormejonathan "delormejonathan (20 commits)")[![nteath](https://avatars.githubusercontent.com/u/1489566?v=4)](https://github.com/nteath "nteath (4 commits)")[![septagram](https://avatars.githubusercontent.com/u/5250951?v=4)](https://github.com/septagram "septagram (1 commits)")

---

Tags

laravelrouting

### Embed Badge

![Health badge](/badges/delormejonathan-laravel-js-routing/health.svg)

```
[![Health](https://phpackages.com/badges/delormejonathan-laravel-js-routing/health.svg)](https://phpackages.com/packages/delormejonathan-laravel-js-routing)
```

###  Alternatives

[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

541629.5k3](/packages/codezero-laravel-localized-routes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
