mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 12:04:04 +00:00
Laravel 13.24 support (fix #1474)
- We conditionally use either $signature + specifyParameters() in the newer versions or just $name in the older versions. There doesn't appear to be a single solution that'd work in both versions, likely having to do with the constructor override in the trait and how the specifyParameters() method behaves differently in this class between versions - Remove unnecessary options from the Run command (the trait adds those) - Not directly related: make HasTenantOptions accept ...$args - Unrelated: remove phpstan ignore in TenancyServiceProvider
This commit is contained in:
parent
553f57a8ad
commit
f5f5a44ca7
4 changed files with 17 additions and 9 deletions
|
|
@ -16,11 +16,21 @@ class Seed extends SeedCommand
|
|||
|
||||
protected $description = 'Seed tenant database(s).';
|
||||
|
||||
protected $name = 'tenants:seed';
|
||||
|
||||
public function __construct(ConnectionResolverInterface $resolver)
|
||||
{
|
||||
parent::__construct($resolver);
|
||||
// See https://github.com/archtechx/tenancy/issues/1474
|
||||
if (version_compare(app()->version(), '13.24.0', '>=')) {
|
||||
$this->signature = 'tenants:seed
|
||||
{class? : The class name of the root seeder}
|
||||
{--class=Database\\Seeders\\DatabaseSeeder : The class name of the root seeder}
|
||||
{--database= : The database connection to seed}
|
||||
{--force : Force the operation to run when in production}';
|
||||
parent::__construct($resolver);
|
||||
$this->specifyParameters();
|
||||
} else {
|
||||
$this->name = 'tenants:seed';
|
||||
parent::__construct($resolver);
|
||||
}
|
||||
}
|
||||
|
||||
public function handle(): int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue