1 | <?php namespace Distilleries\Expendable; |
||
14 | class ExpendableServiceProvider extends ServiceProvider { |
||
15 | |||
16 | /** |
||
17 | * Indicates if loading of the provider is deferred. |
||
18 | * |
||
19 | * @var bool |
||
20 | */ |
||
21 | protected $defer = true; |
||
22 | |||
23 | /** |
||
24 | * Bootstrap the application events. |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | 584 | public function boot() |
|
29 | { |
||
30 | |||
31 | 584 | $this->loadViewsFrom(__DIR__ . '/../../views', 'expendable'); |
|
32 | 584 | $this->loadTranslationsFrom(__DIR__ . '/../../lang', 'expendable'); |
|
33 | 584 | $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations/'); |
|
34 | |||
35 | |||
36 | 584 | $this->publishes([ |
|
37 | 584 | __DIR__ . '/../../config/config.php' => config_path('expendable.php'), |
|
38 | 584 | __DIR__ . '/../../database/seeds/' => base_path('/database/seeds'), |
|
39 | ]); |
||
40 | |||
41 | |||
42 | 584 | $this->publishes([ |
|
43 | 584 | __DIR__ . '/../../views' => base_path('resources/views/vendor/expendable'), |
|
44 | 584 | ], 'views'); |
|
45 | 584 | $this->mergeConfigFrom( |
|
46 | 584 | __DIR__ . '/../../config/config.php', 'expendable' |
|
47 | ); |
||
48 | |||
49 | 584 | $autoLoaderListener = new \Distilleries\Expendable\Register\ListenerAutoLoader(config('expendable.listener')); |
|
50 | 584 | $autoLoaderListener->load(); |
|
51 | |||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Register the service provider. |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | 584 | public function register() |
|
60 | { |
||
61 | |||
62 | |||
63 | $this->app->singleton('Distilleries\Expendable\Contracts\LockableContract', function($app) |
||
|
|||
64 | { |
||
65 | 8 | return new User; |
|
66 | 584 | }); |
|
67 | |||
68 | $this->app->singleton('Distilleries\Expendable\Contracts\StateDisplayerContract', function($app) |
||
69 | { |
||
70 | 288 | return new StateDisplayer($app['view'], $app['config']->get('expendable')); |
|
71 | 584 | }); |
|
72 | |||
73 | $this->app->singleton('Distilleries\Expendable\Contracts\LayoutManagerContract', function($app) |
||
74 | { |
||
75 | 284 | return new LayoutManager($app['config']->get('expendable'), $app['view'], $app['files'], app('Distilleries\Expendable\Contracts\StateDisplayerContract')); |
|
76 | 584 | }); |
|
77 | |||
78 | 584 | $this->alias(); |
|
79 | 584 | $this->registerCommands(); |
|
80 | 584 | $this->registerImporters(); |
|
81 | 584 | $this->registerExporters(); |
|
82 | |||
83 | |||
84 | } |
||
85 | |||
86 | |||
87 | 584 | protected function registerImporters() |
|
104 | |||
105 | 584 | protected function registerExporters() |
|
106 | { |
||
107 | |||
108 | $this->app->singleton('Distilleries\Expendable\Contracts\CsvExporterContract', function() |
||
109 | { |
||
110 | 4 | return new CsvExporter; |
|
111 | 584 | }); |
|
112 | $this->app->singleton('Distilleries\Expendable\Contracts\ExcelExporterContract', function() |
||
113 | { |
||
114 | return new ExcelExporter; |
||
115 | 584 | }); |
|
116 | |||
117 | |||
118 | } |
||
119 | |||
120 | |||
121 | 584 | protected function registerCommands() |
|
134 | |||
135 | 40 | public function provides() |
|
150 | |||
151 | |||
152 | 584 | public function alias() |
|
160 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.