mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 05:44:04 +00:00
Execute the bootstrappers in reverse order when reverting to central context
Bootstrappers order may be relevant in specific cases. For example, when a custom bootstrapper queries the tenant database, it will be placed after the Database bootstrapper and must be reverted before the database connection is reverted back to central.
This commit is contained in:
parent
85c7465aca
commit
1c952023e1
1 changed files with 1 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ class RevertToCentralContext
|
|||
{
|
||||
event(new RevertingToCentralContext($event->tenancy));
|
||||
|
||||
foreach ($event->tenancy->getBootstrappers() as $bootstrapper) {
|
||||
foreach (array_reverse($event->tenancy->getBootstrappers()) as $bootstrapper) {
|
||||
$bootstrapper->revert();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue