File tree Expand file tree Collapse file tree 3 files changed +3
-102
lines changed
Expand file tree Collapse file tree 3 files changed +3
-102
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ class BladeRouteGenerator
88{
99 private $ router ;
1010 public $ routes ;
11- private static $ token = '@__ziggy_was_here__@ ' ;
1211
1312 public function __construct (Router $ router )
1413 {
@@ -18,11 +17,9 @@ public function __construct(Router $router)
1817 public function generate ()
1918 {
2019 $ json = (string ) $ this ->nameKeyedRoutes ();
21- $ token = self ::getToken ();
2220
2321 return <<<EOT
2422<script type="text/javascript">
25- // $ token
2623 var namedRoutes = JSON.parse(' $ json');
2724
2825 function route (name, params) {
@@ -44,9 +41,4 @@ public function nameKeyedRoutes()
4441 return collect ($ route )->only (['uri ' , 'methods ' ]);
4542 });
4643 }
47-
48- public static function getToken ()
49- {
50- return self ::$ token ;
51- }
5244}
Original file line number Diff line number Diff line change 88
99class ZiggyServiceProvider extends ServiceProvider
1010{
11- public function boot (BladeRouteGenerator $ generator )
11+ public function boot ()
1212 {
13- if (config ('app.env ' ) === 'local ' || config ('ziggy.skip_view_cache ' ) === true ) {
14- $ this ->app ->singleton ('blade.compiler ' , function () {
15- return new ZiggyTokenBladeCompiler (
16- $ this ->app ['files ' ], $ this ->app ['config ' ]['view.compiled ' ]
17- );
18- });
19- }
20-
21- Blade::directive ('routes ' , function () use ($ generator ) {
22- return $ generator ->generate ();
13+ Blade::directive ('routes ' , function () {
14+ return "<?php echo app(' " . BladeRouteGenerator::class . "')->generate(); ?> " ;
2315 });
2416 }
2517}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments