Download the PHP package surgio/laroute without Composer
On this page you can find all versions of the php package surgio/laroute. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download surgio/laroute
More information about surgio/laroute
Files in surgio/laroute
Package laroute
Short Description Access Laravels URL/Route helper functions, from JavaScript.
License MIT
Informations about the package laroute
Laroute
Fork of (aaronlord/laroute)[https://github.com/aaronlord/laroute/pull/95], which updates the seemingly dead package to the current version of Laravel. It's recommended to use (https://github.com/tightenco/ziggy)[https://github.com/tightenco/ziggy] instead.
Laravel has some pretty sweet helper functions for generating urls/links and its auto-json-magic makes it building APIs super easy. It's my go-to choice for building single-page js apps, but routing can quickly become a bit of a pain.
Wouldn't it be amazing if we could access our Laravel routes from JavaScript?
This package allows us to port our routes over to JavaScript, and gives us a bunch of very familiar helper functions to use.
Installation
Install the usual composer way.
composer.json
app/config/app.php
Configure (optional)
Copy the packages config files.
app/config/laroute.php
Generate the laroute.js
To access the routes, we need to "port" them over to a JavaScript file:
With the default configuration, this will create a public/js/laroute.js
file to include in your page, or build.
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.
route
Generate a URL for a given named route.
url
Generate a fully qualified URL to the given path.
link_to
Generate a html link to the given url.
link_to_route
Generate a html link to the given route.
link_to_action
Generate a html link to the given action.
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.
Licence
All versions of laroute with dependencies
illuminate/support Version 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/routing Version 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/console Version 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/config Version 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/filesystem Version 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0