diff --git a/src/Commands/SeedDatabaseCommand.php b/src/Commands/SeedDatabaseCommand.php index cd56a20..b0f2048 100644 --- a/src/Commands/SeedDatabaseCommand.php +++ b/src/Commands/SeedDatabaseCommand.php @@ -5,6 +5,8 @@ use Illuminate\Database\Console\Seeds\SeedCommand as BaseSeedCommand; use Native\Laravel\NativeServiceProvider; use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; #[AsCommand( name: 'native:seed', @@ -14,8 +16,19 @@ class SeedDatabaseCommand extends BaseSeedCommand { protected $signature = 'native:seed'; + protected function configure(): void + { + parent::configure(); + + $this->addArgument('class', mode: InputArgument::OPTIONAL, description: 'The class name of the root seeder'); + $this->addOption('class', mode: InputOption::VALUE_OPTIONAL, description: 'The class name of the root seeder', default: 'Database\\Seeders\\DatabaseSeeder'); + } + public function handle() { + // Add the database option here so it won't show up in `--help` + $this->addOption('database', mode: InputOption::VALUE_REQUIRED, default: 'nativephp'); + (new NativeServiceProvider($this->laravel))->rewriteDatabase(); return parent::handle();