1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 18:14:04 +00:00

postCreationActions

This commit is contained in:
Samuel Štancl 2019-10-21 20:51:31 +02:00
parent 394d976863
commit 3575e0dcdf

View file

@ -87,7 +87,7 @@ class TenantManager
}; };
} }
$afterCreating = array_merge($afterCreating, $this->getUserPostCreationCallbacks()); $afterCreating = array_merge($afterCreating, $this->getUserPostCreationActions());
$this->database->createDatabase($tenant, $afterCreating); $this->database->createDatabase($tenant, $afterCreating);
@ -337,10 +337,15 @@ 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 getUserPostCreationCallbacks(): array * A user-specified list of callbacks or jobs executed after
* creating, migrating, and seeding the tenant database.
*
* @return \Illuminate\Contracts\Queue\ShouldQueue[]|callable[]
*/
public function getUserPostCreationActions(): array
{ {
return $this->app['tenancy.postCreationCallbacks'] ?? []; return $this->app['tenancy.postCreationActions'] ?? [];
} }
public function databaseCreationQueued(): bool public function databaseCreationQueued(): bool