mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 19:24:03 +00:00
Refactor more old code and get tests to pass
This commit is contained in:
parent
c5377a16f7
commit
c32f229dd5
72 changed files with 425 additions and 531 deletions
18
src/Listeners/RevertToCentralContext.php
Normal file
18
src/Listeners/RevertToCentralContext.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Stancl\Tenancy\Listeners;
|
||||
|
||||
use Stancl\Tenancy\Events\RevertedToCentralContext;
|
||||
use Stancl\Tenancy\Events\TenancyEnded;
|
||||
|
||||
class RevertToCentralContext
|
||||
{
|
||||
public function handle(TenancyEnded $event)
|
||||
{
|
||||
foreach ($event->tenancy->getBootstrappers() as $bootstrapper) {
|
||||
$bootstrapper->revert();
|
||||
}
|
||||
|
||||
event(new RevertedToCentralContext($event->tenancy));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue