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