added progress bar

This commit is contained in:
denisdulici 2020-03-10 19:09:13 +03:00
parent cdf5312023
commit adbc26a6bd

View File

@ -27,12 +27,35 @@ class SampleData extends Seeder
$count = (int) $this->command->option('count');
$acc_count = ($count <= 10) ? $count : 10;
$this->command->info('Creating sample data...');
$bar = $this->command->getOutput()->createProgressBar(6);
$bar->setFormat('verbose');
$bar->start();
factory(Contact::class, $count)->create();
$bar->advance();
factory(Category::class, $count)->create();
$bar->advance();
factory(Item::class, $count)->create();
$bar->advance();
factory(Account::class, $acc_count)->create();
$bar->advance();
factory(Bill::class, $count)->create();
$bar->advance();
factory(Invoice::class, $count)->create();
$bar->advance();
$bar->finish();
$this->command->info('');
$this->command->info('Sample data created.');
Model::unguard();
}