jeylabs/jsroute
Larablocks Analysis
jeylabs/jsroute works with Laravel 5 (latest release v1.0.2, Jun 2, 2015), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Jun 2, 2015)
- 0 downloads a month (needs 10,000)
- 1 GitHub star (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Jun 2, 2015.
- No releases in the last 12 months.
- First released: May 28, 2015.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 30, 2026.
| Install | |
|---|---|
composer require jeylabs/jsroute |
|
| Latest Version: | v1.0.2 |
| PHP: | >=5.4.0 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Jun 2, 2015 |
| Links: | GitHub · Packagist |
Generate the laroute.js
To access the routes, we need to "port" them over to a JavaScript file:
php artisan laroute:generate
With the default configuration, this will create a public/js/laroute.js file to include in your page, or build.
<script src="/js/laroute.js"></script>
Note: You'll have to laroute:generate if you change your routes.
JavaScript Documentation
By default, all of the functions are under the laroute namespace. This documentation will stick with this convention.
action
Generate a URL for a given controller action.
/**
* laroute.action(action, [parameters = {}])
*
* action : The action to route to.
* parameters : Optional. key:value object literal of route parameters.
*/
laroute.action('HomeController@getIndex');
route
Generate a URL for a given named route.
/**
* laroute.route(name, [parameters = {}])
*
* name : The name of the route to route to.
* parameters : Optional. key:value object literal of route parameters.
*/
laroute.route('Hello.{planet}', { planet : 'world' });
url
Generate a fully qualified URL to the given path.
/**
* laroute.url(name, [parameters = []])
*
* name : The name of the route to route to.
* parameters : Optional. value array of route parameters.
*/
laroute.url('foo/bar', ['aaa', 'bbb']); // -> /foo/bar/aaa/bbb
link_to
Generate a html link to the given url.
/**
* laroute.link_to(url, [title = url, attributes = {}]])
*
* url : A relative url.
* title : Optional. The anchor text to display
* attributes : Optional. key:value object literal of additional html attributes.
*/
laroute.link_to('foo/bar', 'Foo Bar', { style : "color:#bada55;" });
link_to_route
Generate a html link to the given route.
/**
* laroute.link_to_route(name, [title = url, parameters = {}], attributes = {}]]])
*
* name : The name of the route to route to.
* title : Optional. The anchor text to display
* parameters : Optional. key:value object literal of route parameters.
* attributes : Optional. key:value object literal of additional html attributes.
*/
laroute.link_to_route('home', 'Home');
link_to_action
Generate a html link to the given action.
/**
* laroute.link_to_action(action, [title = url, parameters = {}], attributes = {}]]])
*
* action : The action to route to.
* title : Optional. The anchor text to display
* parameters : Optional. key:value object literal of route parameters.
* attributes : Optional. key:value object literal of additional html attributes.
*/
laroute.link_to_action('HelloController@planet', undefined, { planet : 'world' });
PHP Documentation
Ignore/Filter Routes
By default, all routes are available to laroute after a php artisan laroute:generate. However, it is sometimes desirable to have laroute ignore certain routes. You can do this by passing a laroute route option.
Route::get('/ignore-me', [
'laroute' => false,
'as' => 'ignoreme',
'uses' => 'IgnoreController@me'
]);
Route::group(['laroute' => false], function () {
Route::get('/groups-are-super-useful', 'GroupsController@index');
});
Alternatives to jeylabs/jsroute
Detects the user’s preferred language and redirects to the matching localized UR...
A convenient way to set up, manage and use localized routes in a Laravel app.
A convenient way to set up, manage and use localized routes in a Laravel app.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.0.2 | >=5.4.0 | 5.* | MIT | |
| v1.0.1 | >=5.4.0 | 5.0.* | MIT | |
| v1.0.0 | >=5.4.0 | 5.0.* | MIT |