Last active
October 25, 2019 08:30
-
-
Save nasrulhazim/3f057293c5dbac758716242e3c96ed82 to your computer and use it in GitHub Desktop.
Added Progress Bar on Seeding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
trait SeedingProgressBar | |
{ | |
public function run() | |
{ | |
$seeders = $this->seeders; | |
$this->command->info('Seeding ' . __CLASS__ . '...'); | |
$this->command->getOutput()->progressStart(count($seeders)); | |
foreach ($seeders as $class => $is_class) { | |
if ($is_class) { | |
$this->call($class, true); | |
} else { | |
$method = $class; | |
$this->$method(); | |
} | |
$this->command->getOutput()->progressAdvance(); | |
} | |
$this->command->getOutput()->progressFinish(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello. I have problem.
Illuminate\Contracts\Container\BindingResolutionException : Target class [MessageFactorySeeder] does not exist.
I have DatabaseSeeder and MessageFactorySeeder in one folder.
should I add something to composer?