1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-09-20 14:34:03 +00:00

Restore explanatory comments in Seed::__construct and configure()

This commit is contained in:
Lucas Michot 2026-08-08 20:21:38 +02:00
parent 5a5ab2baf6
commit dd34ebd64d

View file

@ -20,6 +20,10 @@ class Seed extends SeedCommand
{ {
parent::__construct($resolver); parent::__construct($resolver);
// Our --tenants/--skip-tenants/--with-pending options only get added automatically
// when the parent command isn't signature-based. Since Laravel 13.24, SeedCommand is,
// so we add them ourselves here -- checking first so we don't add them twice on older
// Laravel versions, where they're already there by this point.
if (! $this->getDefinition()->hasOption('tenants')) { if (! $this->getDefinition()->hasOption('tenants')) {
$this->specifyParameters(); $this->specifyParameters();
} }
@ -29,6 +33,10 @@ class Seed extends SeedCommand
{ {
parent::configure(); parent::configure();
// We inherit SeedCommand's name ('db:seed') since we don't redeclare $name/$signature,
// so without this we'd overwrite Laravel's own db:seed command (see #1474). configure()
// always runs after the name is set, regardless of Laravel version, so setting it here
// is safe no matter which of $name/$signature the installed Laravel version uses.
$this->setName('tenants:seed'); $this->setName('tenants:seed');
} }