public function seedTask(Option $option)
    {
        $name = $option->getArg(0);
        $databases = $this->getDatabases($option);
        
        $start = microtime(true);
        foreach ($databases as $alias => $database) {
            foreach ($this->migrationHelper->getSeeders($alias, $name) as $seeder) {
                try {
                    $this->sendMessage('seeding... -> %s', $seeder->getName());
                    $seeder->seed();
                } catch (\Exception $e) {
                    $this->sendMessage($e->getMessage());
                    $this->sendMessage('has error. aborting.');
                    return;
                }
            }
        }
        $end = microtime(true);

        $this->sendMessage('');
        $this->sendMessage('All Done. Took %.4fs', $end - $start);
    }
public function seedTask(Option $option)
    {
        $name = $option->getArg(0);
        $databases = $this->getDatabases($option);
        
        $start = microtime(true);
        foreach ($databases as $alias => $database) {
            foreach ($this->migrationHelper->getSeeders($alias, $name) as $seeder) {
                try {
                    $this->sendMessage('seeding... -> %s', $seeder->getName());
                    $seeder->seed();
                } catch (\Exception $e) {
                    $this->sendMessage($e->getMessage());
                    $this->sendMessage('has error. aborting.');
                    return;
                }
            }
        }
        $end = microtime(true);

        $this->sendMessage('');
        $this->sendMessage('All Done. Took %.4fs', $end - $start);
    }
public function seedTask ( Option $ option ) { $ name = $ option -> getArg ( 0 ) ; $ databases = $ this -> getDatabases ( $ option ) ; $ start = microtime ( true ) ; foreach ( $ databases as $ alias => $ database ) { foreach ( $ this -> migrationHelper -> getSeeders ( $ alias , $ name ) as $ seeder ) { try { $ this -> sendMessage ( 'seeding... -> %s' , $ seeder -> getName ( ) ) ; $ seeder -> seed ( ) ; } catch ( \ Exception $ e ) { $ this -> sendMessage ( $ e -> getMessage ( ) ) ; $ this -> sendMessage ( 'has error. aborting.' ) ; return ; } } } $ end = microtime ( true ) ; $ this -> sendMessage ( '' ) ; $ this -> sendMessage ( 'All Done. Took %.4fs' , $ end - $ start ) ; }
database seeding task.

usage:
# all seeding files import.
$ ./app db:seed

# target seeding file import.
$ ./app db:seed [name] --database=base

seeder file:
App/Database/Seed/[database alias]/[name]Seeder.php

@option      database,d=all      target database (default is all databases).
database seeding task .