mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:44:02 +00:00
23 lines
574 B
PHP
23 lines
574 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Listeners;
|
|
|
|
use Stancl\Tenancy\Events\BootstrappingTenancy;
|
|
use Stancl\Tenancy\Events\TenancyBootstrapped;
|
|
use Stancl\Tenancy\Events\TenancyInitialized;
|
|
|
|
class BootstrapTenancy
|
|
{
|
|
public function handle(TenancyInitialized $event): void
|
|
{
|
|
event(new BootstrappingTenancy($event->tenancy));
|
|
|
|
foreach ($event->tenancy->getBootstrappers() as $bootstrapper) {
|
|
$bootstrapper->bootstrap($event->tenancy->tenant);
|
|
}
|
|
|
|
event(new TenancyBootstrapped($event->tenancy));
|
|
}
|
|
}
|