| Total Complexity | 7 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class ModelSuspensionServiceProvider extends ServiceProvider |
||
| 9 | { |
||
| 10 | public function boot() |
||
| 13 | } |
||
| 14 | |||
| 15 | public function register() |
||
| 16 | { |
||
| 17 | $this->mergeConfigFrom(__DIR__ . '/../config/model-suspension.php', 'model-suspension'); |
||
| 18 | } |
||
| 19 | |||
| 20 | protected function registerPublishables(): void |
||
| 21 | { |
||
| 22 | if ($this->app->runningInConsole()) { |
||
| 23 | $this->loadMigrationsFrom(__DIR__.'/../database/migrations/'); |
||
| 24 | } |
||
| 25 | |||
| 26 | if (! class_exists('CreateSuspensionsTable')) { |
||
| 27 | $timestamp = date('Y_m_d_His', time()); |
||
| 28 | |||
| 29 | $this->publishes([ |
||
| 30 | __DIR__ . '/../database/migrations/create_suspensions_table.php.stub' => database_path('migrations/'.$timestamp.'_create_suspensions_table.php'), |
||
| 31 | ], 'migrations'); |
||
| 32 | } |
||
| 33 | |||
| 34 | $this->publishes([ |
||
| 35 | __DIR__.'/../config/model-suspension.php' => config_path('model-suspension.php'), |
||
| 36 | ], 'config'); |
||
| 37 | |||
| 38 | $this->guardAgainstInvalidSuspensionModel(); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function guardAgainstInvalidSuspensionModel() |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 50 |