1: <?php
2: namespace Menu;
3:
4: use Illuminate\Support\ServiceProvider;
5:
6: 7: 8:
9: class MenuServiceProvider extends ServiceProvider
10: {
11:
12: 13: 14: 15: 16:
17: protected $defer = false;
18:
19: 20: 21: 22: 23:
24: public function register()
25: {
26: $configPath = __DIR__ . '/../config/config.php';
27: $this->mergeConfigFrom($configPath, 'menu');
28:
29: $container = Menu::getContainer();
30: $container['url'] = $this->app['url'];
31: $container['config'] = $this->app['config'];
32: Menu::setContainer($container);
33: }
34:
35: 36: 37: 38: 39:
40: public function provides()
41: {
42: return array('menu');
43: }
44:
45: 46: 47: 48: 49:
50: public function boot()
51: {
52: $configPath = __DIR__ . '/../config/config.php';
53: $this->publishes([$configPath => config_path('menu.php')], 'config');
54: }
55: }
56: