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