| Total Complexity | 9 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class AuthorizeNetServiceProvider extends ServiceProvider |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Register any application services. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function register(): void |
||
| 15 | { |
||
| 16 | $configPath = __DIR__.'/../../config/authorizenet.php'; |
||
| 17 | |||
| 18 | if (file_exists($configPath)) { |
||
| 19 | $this->mergeConfigFrom($configPath, 'authorizenet'); |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Bootstrap any application services. |
||
| 25 | * |
||
| 26 | * @return void |
||
| 27 | */ |
||
| 28 | public function boot(): void |
||
| 29 | { |
||
| 30 | $this->loadMigrations(); |
||
| 31 | $this->publishConfig(); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Load package migrations. |
||
| 36 | * |
||
| 37 | * @return void |
||
| 38 | */ |
||
| 39 | protected function loadMigrations(): void |
||
| 40 | { |
||
| 41 | if ($this->app->runningInConsole()) { |
||
| 42 | $migrationsPath = __DIR__.'/../../database/migrations'; |
||
| 43 | |||
| 44 | if (is_dir($migrationsPath)) { |
||
| 45 | $this->loadMigrationsFrom($migrationsPath); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Publish the configuration file. |
||
| 52 | * |
||
| 53 | * @return void |
||
| 54 | */ |
||
| 55 | protected function publishConfig(): void |
||
| 64 | } |
||
| 65 | } |
||
| 66 | } |
||
| 67 | |||
| 71 |