Total Complexity | 3 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class LarapayServiceProvider extends ServiceProvider |
||
9 | { |
||
10 | /** |
||
11 | * Register Service Provider. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | public function register() |
||
16 | { |
||
17 | $this->mergeConfigFrom($this->getConfigPath(), 'larapay'); |
||
18 | |||
19 | $this->app->singleton(Payments::class, function ($app) { |
||
20 | return new GatewayManager($app['config']); |
||
21 | }); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Boot Service Provider. |
||
26 | * |
||
27 | * @return void |
||
28 | */ |
||
29 | public function boot() |
||
30 | { |
||
31 | $this->publishes([ |
||
32 | $this->getConfigPath() => config_path('larapay.php'), |
||
33 | ]); |
||
34 | |||
35 | $this->loadViewsFrom(__DIR__ . '/../files/views', 'larapay'); |
||
36 | |||
37 | $this->loadMigrationsFrom(__DIR__ . '/../files/database/migrations'); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Get default config path. |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | protected function getConfigPath(): string |
||
48 | } |
||
49 | } |
||
50 |