PHP code example of dbt / command-seeder

1. Go to this page and download the library: Download dbt/command-seeder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dbt / command-seeder example snippets


'seeders' => [
    'my-seeder' => MySeeder::class,
];

public function argumentNames(): ArgumentNames
{
    return new ArgumentNames('firstArg', 'secondArg', 'etc');
}

public function run(Arguments $arguments, int $quantity): void
{
    $firstArg = $arguments->get('firstArg');
    $allArgs = $arguments->all();
    
    // Create some models...
    
    $this->output->info('Write some output...');
}
bash
php artisan vendor:publish --provider="Dbt\CommandSeeder\CommandSeederServiceProvider" --tag="config"
bash
php artisan seed:command {seederName} {quantity} {...arguments}