hadefication / trail
Your package description here
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- laravel/framework: ~5.6.7
Requires (Dev)
- orchestra/testbench: ~3.0
This package is auto-updated.
Last update: 2024-11-24 21:30:02 UTC
README
This package will expose a @trail
blade directive that you can include into your master blade or layout file. This blade directive exposes a Trail
JavaScript object that contains config and the collection of named routes that your application has. The directive also exposes a helper method named route
for convenience, if you know what I mean.
Usage
- Add this package to your Laravel application by running
composer require hadefication/trail
- Include
@trail
to your master blade or your main layout file. - Start using
route('route.name')
in your JavaScript to access route URLs. - That's all about it! Noice eh!?
Configs
The package comes with a nifty config file where you can customize how the package will behave.
excludeNamedRoutesToDirective
: as the config suggests, this config, if set totrue
, it will exclude the routes collection dump in theTrail
object.excludeRouteHelperMethodToDirective
: yep, if set totrue
, it will exclude theroute
helper method in the JavaScript export done in@trail
directive.excludeRoutes
: This config accepts an array of route names or route URI path that you wish to be excluded in the route collection dump added in Trail.