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