mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 11:14:03 +00:00
User post-creation callbacks
This commit is contained in:
parent
d4d6c747d2
commit
f7a8dbcbb9
1 changed files with 8 additions and 0 deletions
|
|
@ -87,6 +87,8 @@ class TenantManager
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$afterCreating = array_merge($afterCreating, $this->getUserPostCreateCallbacks());
|
||||||
|
|
||||||
$this->database->createDatabase($tenant, $afterCreating);
|
$this->database->createDatabase($tenant, $afterCreating);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
@ -335,6 +337,12 @@ class TenantManager
|
||||||
return $this->shouldMigrateAfterCreation() && $this->app['config']['tenancy.seed_after_migration'] ?? false;
|
return $this->shouldMigrateAfterCreation() && $this->app['config']['tenancy.seed_after_migration'] ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return callable[] */
|
||||||
|
public function getUserPostCreateCallbacks(): array
|
||||||
|
{
|
||||||
|
return $this->app['tenancy.postCreationCallbacks'] ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
public function databaseCreationQueued(): bool
|
public function databaseCreationQueued(): bool
|
||||||
{
|
{
|
||||||
return $this->app['config']['tenancy.queue_database_creation'] ?? false;
|
return $this->app['config']['tenancy.queue_database_creation'] ?? false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue