diff --git a/README.md b/README.md index 86a49e3b..1a64ebe2 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Ziggy creates a Blade directive which you can include in your views. This will e 2. (if Laravel 5.4) Add `Tightenco\Ziggy\ZiggyServiceProvider::class` to the `providers` array in your `config/app.php`. -3. Include our Blade Directive (`@jsroutes`) somewhere in your template before your main application JavaScript is loaded--likely in the header somewhere. +3. Include our Blade Directive (`@routes`) somewhere in your template before your main application JavaScript is loaded--likely in the header somewhere. ## Usage diff --git a/src/BladeRouteGenerator.php b/src/BladeRouteGenerator.php index 039a55ac..494efb6c 100644 --- a/src/BladeRouteGenerator.php +++ b/src/BladeRouteGenerator.php @@ -19,7 +19,7 @@ public function generate() return << - var namedRoutes = JSON.parse('{ $routes }'); + var namedRoutes = JSON.parse('$routes'); function route (name, params) { return namedRoutes[name].uri.replace( @@ -36,7 +36,7 @@ function (tag) { private function nameKeyedRoutes() { return collect($this->router->getRoutes()->getRoutesByName())->map(function ($route) { - return collect($route)->only(['uri', 'methods', 'parameters']); + return collect($route)->only(['uri', 'methods']); }); } }