mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 21:04:03 +00:00
[2.x] Queued post-creation automigration (#154)
* Queued post-creation automigration * Add shouldQueueMigration() * Automigration test, config key, QueueTenancyBootstrapper support for QueueFake * Apply fixes from StyleCI * Fix if statement
This commit is contained in:
parent
b66574b1ab
commit
abd0b8f04e
7 changed files with 88 additions and 6 deletions
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy\TenancyBootstrappers;
|
||||
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Support\Testing\Fakes\QueueFake;
|
||||
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
||||
use Stancl\Tenancy\Tenant;
|
||||
|
||||
|
|
@ -21,9 +22,13 @@ class QueueTenancyBootstrapper implements TenancyBootstrapper
|
|||
$this->app = $app;
|
||||
|
||||
$bootstrapper = &$this;
|
||||
$this->app['queue']->createPayloadUsing(function () use (&$bootstrapper) {
|
||||
return $bootstrapper->getPayload();
|
||||
});
|
||||
|
||||
$queue = $this->app['queue'];
|
||||
if (! $queue instanceof QueueFake) {
|
||||
$queue->createPayloadUsing(function () use (&$bootstrapper) {
|
||||
return $bootstrapper->getPayload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function start(Tenant $tenant)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue