mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-14 11:54:04 +00:00
-ing event behavior
This commit is contained in:
parent
c40dba4e02
commit
33d6fd82da
9 changed files with 120 additions and 6 deletions
|
|
@ -13,6 +13,7 @@ use Illuminate\Queue\SerializesModels;
|
|||
use Stancl\Tenancy\Contracts\TenantWithDatabase;
|
||||
use Stancl\Tenancy\Contracts\Tenant;
|
||||
use Stancl\Tenancy\DatabaseManager;
|
||||
use Stancl\Tenancy\Events\CreatingDatabase;
|
||||
use Stancl\Tenancy\Events\DatabaseCreated;
|
||||
|
||||
class CreateDatabase implements ShouldQueue
|
||||
|
|
@ -29,6 +30,8 @@ class CreateDatabase implements ShouldQueue
|
|||
|
||||
public function handle(DatabaseManager $databaseManager)
|
||||
{
|
||||
event(new CreatingDatabase($this->tenant));
|
||||
|
||||
if ($this->tenant->getInternal('create_database') !== false) {
|
||||
$databaseManager->ensureTenantCanBeCreated($this->tenant);
|
||||
$this->tenant->database()->makeCredentials();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue