mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 00:54:05 +00:00
Fix Queue tenancy
This commit is contained in:
parent
23cf9e5366
commit
10c5f8d98d
2 changed files with 13 additions and 8 deletions
|
|
@ -47,6 +47,13 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
|
||||
return $instance;
|
||||
});
|
||||
|
||||
// Queue tenancy
|
||||
$this->app['events']->listen(\Illuminate\Queue\Events\JobProcessing::class, function ($event) {
|
||||
if (array_key_exists('tenant_id', $event->job->payload())) {
|
||||
tenancy()->initialize(tenancy()->find($event->job->payload()['tenant_id']));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue