| Conditions | 5 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.025 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 46 | public function handle() |
|
| 30 | { |
||
| 31 | 46 | if (!$this->confirmToProceed()) { |
|
| 32 | return; |
||
| 33 | } |
||
| 34 | |||
| 35 | 46 | $this->resolver->setDefaultConnection($this->getDatabase()); |
|
| 36 | |||
| 37 | Model::unguarded(function () { |
||
| 38 | 46 | foreach ($this->getSeeders() as $seeder) { |
|
| 39 | 46 | $seeder = $this->laravel->make($seeder); |
|
| 40 | 46 | if (!isset($seeder->enabled) || $seeder->enabled) |
|
| 41 | 46 | $seeder->__invoke(); |
|
| 42 | } |
||
| 43 | 46 | }); |
|
| 44 | |||
| 45 | 46 | $this->info('Database seeding completed successfully.'); |
|
| 46 | 46 | } |
|
| 55 |