mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 12:54:05 +00:00
improvements
This commit is contained in:
parent
1f8b5fdb7c
commit
fd012a13b0
1 changed files with 1 additions and 4 deletions
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Stancl\Tenancy\Listeners;
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Stancl\Tenancy\Database\DatabaseManager;
|
||||
use Stancl\Tenancy\Events\Contracts\TenancyEvent;
|
||||
|
||||
|
|
@ -12,13 +11,11 @@ class UseCentralConnection
|
|||
{
|
||||
public function __construct(
|
||||
protected DatabaseManager $database,
|
||||
protected Application $app
|
||||
) {
|
||||
}
|
||||
|
||||
public function handle(TenancyEvent $event): void
|
||||
{
|
||||
$this->database->purgeTenantConnection();
|
||||
$this->database->setDefaultConnection($this->app['config']->get('tenancy.database.central_connection'));
|
||||
$this->database->reconnectToCentral();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue