Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/8.x' into 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 9, 2021
2 parents e2e98f4 + 0443f1c commit 5da5b44
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Illuminate/Database/Console/Seeds/SeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Database\ConnectionResolverInterface as Resolver;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;

class SeedCommand extends Command
Expand Down Expand Up @@ -81,7 +82,7 @@ public function handle()
*/
protected function getSeeder()
{
$class = $this->input->getOption('class');
$class = $this->input->getArgument('class') ?? $this->input->getOption('class');

if (strpos($class, '\\') === false) {
$class = 'Database\\Seeders\\'.$class;
Expand Down Expand Up @@ -109,6 +110,18 @@ protected function getDatabase()
return $database ?: $this->laravel['config']['database.default'];
}

/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['class', InputArgument::OPTIONAL, 'The class name of the root seeder', null],
];
}

/**
* Get the console command options.
*
Expand Down

0 comments on commit 5da5b44

Please sign in to comment.