| Conditions | 6 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function handle() |
||
| 18 | { |
||
| 19 | if (app()->environment() != 'local' && !$this->option('force')) { |
||
| 20 | throw new \Exception('You can only run the seeder in the local environment since this will inject a ton of default data'); |
||
| 21 | } |
||
| 22 | |||
| 23 | if (app()->environment() != 'local' && $this->option('force')) { |
||
| 24 | if (!$this->confirm('You are about to inject default seeding data in the '.app()->environment().' database! Are you sure?')) { |
||
| 25 | $this->info('You are welcome. I have just saved your job.'); |
||
| 26 | return; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | $seederClass = $this->argument('seeder'); |
||
| 31 | app($seederClass)->run(); |
||
| 32 | |||
| 33 | $this->info($seederClass.' has run successfully.'); |
||
| 34 | } |
||
| 36 |