mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 17:14:03 +00:00
wip
This commit is contained in:
parent
f7d0451545
commit
0655ff8a03
4 changed files with 12 additions and 10 deletions
|
|
@ -19,11 +19,16 @@ class Migrate extends MigrateCommand
|
|||
|
||||
protected $description = 'Run migrations for tenant(s)';
|
||||
|
||||
protected static function getTenantCommandName(): string
|
||||
{
|
||||
return 'tenants:migrate';
|
||||
}
|
||||
|
||||
public function __construct(Migrator $migrator, Dispatcher $dispatcher)
|
||||
{
|
||||
parent::__construct($migrator, $dispatcher);
|
||||
|
||||
$this->specifyTenantSignature();
|
||||
$this->specifyParameters();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class Rollback extends RollbackCommand
|
|||
{
|
||||
use HasATenantsOption, DealsWithMigrations, ExtendsLaravelCommand;
|
||||
|
||||
protected static function getTenantCommandName()
|
||||
protected static function getTenantCommandName(): string
|
||||
{
|
||||
return 'tenants:rollback';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,21 +6,18 @@ trait ExtendsLaravelCommand
|
|||
{
|
||||
protected function specifyTenantSignature(): void
|
||||
{
|
||||
$this->setName('tenants:migrate');
|
||||
$this->specifyParameters();
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return static::getDefaultName();
|
||||
return static::getTenantCommandName();
|
||||
}
|
||||
|
||||
public static function getDefaultName(): ?string
|
||||
{
|
||||
if (method_exists(static::class, 'getTenantCommandName')) {
|
||||
return static::getTenantCommandName();
|
||||
}
|
||||
|
||||
return 'tenants:' . parent::getDefaultName();
|
||||
return static::getTenantCommandName();
|
||||
}
|
||||
|
||||
abstract protected static function getTenantCommandName(): string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue