File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ 'prepend ' => 'menu_ '
5+ ];
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public function make($name, $callback)
6666
6767 $ this ->collection ->put ($ name , $ menu );
6868
69- $ this ->view ->share (' menu_ ' .$ name , $ menu );
69+ $ this ->view ->share (config ( ' menu.prepend ' , ' menu_ ') .$ name , $ menu );
7070
7171 return $ menu ;
7272 }
Original file line number Diff line number Diff line change 55
66class MenusServiceProvider extends ServiceProvider {
77
8+ public function boot ()
9+ {
10+ $ this ->publishConfig ();
11+ }
812 /**
913 * Indicates if loading of the provider is deferred.
1014 *
@@ -47,4 +51,11 @@ protected function registerServices()
4751 return new Menu ($ app ['config ' ], $ app ['view ' ], $ app ['html ' ], $ app ['url ' ]);
4852 });
4953 }
54+
55+ protected function publishConfig ()
56+ {
57+ $ this ->publishes ([
58+ __DIR__ . '/../config/menu.php ' => config_path ('menu.php ' ),
59+ ], 'caffeinated-menu ' );
60+ }
5061}
You can’t perform that action at this time.
0 commit comments