1 | <?php |
||
24 | class ServiceProvider extends LaravelServiceProvider |
||
25 | { |
||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | protected $defer = true; |
||
30 | |||
31 | /** |
||
32 | * boot service provider |
||
33 | */ |
||
34 | 7 | public function boot() |
|
44 | |||
45 | /** |
||
46 | * register service provider |
||
47 | */ |
||
48 | 7 | public function register() |
|
49 | { |
||
50 | // merge configs |
||
51 | 7 | $this->mergeConfigFrom( |
|
52 | 7 | __DIR__.'/config.php', 'ibrand.setting' |
|
53 | ); |
||
54 | |||
55 | 7 | $this->app->singleton(SettingInterface::class, function ($app) { |
|
|
|||
56 | 4 | $repository = new EloquentSetting(new SystemSetting()); |
|
57 | |||
58 | 4 | if (!config('ibrand.setting.cache')) { |
|
59 | 1 | return $repository; |
|
60 | } |
||
61 | |||
62 | 3 | return new CacheDecorator($repository); |
|
63 | 7 | }); |
|
64 | |||
65 | 7 | $this->app->alias(SettingInterface::class, 'system_setting'); |
|
66 | 7 | } |
|
67 | |||
68 | /** |
||
69 | * Register Passport's migration files. |
||
70 | */ |
||
71 | 7 | protected function registerMigrations() |
|
75 | |||
76 | /** |
||
77 | * @return array |
||
78 | */ |
||
79 | 1 | public function provides() |
|
83 | } |
||
84 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.