1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 02:04:03 +00:00
tenancy/src/Listeners/CreateTenantConnection.php
2020-06-02 16:57:30 +00:00

24 lines
489 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Listeners;
use Stancl\Tenancy\Database\DatabaseManager;
use Stancl\Tenancy\Events\Contracts\TenantEvent;
class CreateTenantConnection
{
/** @var DatabaseManager */
protected $database;
public function __construct(DatabaseManager $database)
{
$this->database = $database;
}
public function handle(TenantEvent $event)
{
$this->database->createTenantConnection($event->tenant);
}
}