Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Commands/Run.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class Run extends Command

protected $description = 'Run a command for tenant(s)';

protected $signature = 'tenants:run {commandname : The artisan command.}
{--tenants=* : The tenant(s) to run the command for. Default: all}
{--skip-tenants=* : The tenant(s) to skip}';
protected $signature = 'tenants:run {commandname : The artisan command.}';

public function handle(): int
{
Expand Down
16 changes: 13 additions & 3 deletions src/Commands/Seed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/HasTenantOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ protected function getTenantsQuery(?array $tenantKeys = null): Builder
});
}

public function __construct()
public function __construct(mixed ...$args)
{
parent::__construct();
parent::__construct(...$args);

$this->specifyParameters();
}
Expand Down
2 changes: 1 addition & 1 deletion src/TenancyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function register(): void
$config['connection'] ??= $centralConnection;

/** @var CacheManager $this */
return $this->createDatabaseDriver($config); // @phpstan-ignore method.protected
return $this->createDatabaseDriver($config);
});

// DatabaseCacheBootstrapper explicitly writes 'tenant' into each store's 'connection'
Expand Down
Loading