mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 21:14:03 +00:00
Use withtenantDatabases where needed
This commit is contained in:
parent
cda2a57fb0
commit
23b028da36
5 changed files with 31 additions and 11 deletions
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
|
||||
use Stancl\Tenancy\Tests\TestCase;
|
||||
use Stancl\JobPipeline\JobPipeline;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Stancl\Tenancy\Jobs\CreateDatabase;
|
||||
use Stancl\Tenancy\Events\TenantCreated;
|
||||
|
||||
uses(TestCase::class)->in(__DIR__);
|
||||
|
||||
|
|
@ -8,3 +12,10 @@ function pest(): TestCase
|
|||
{
|
||||
return Pest\TestSuite::getInstance()->test;
|
||||
}
|
||||
|
||||
function withTenantDatabases()
|
||||
{
|
||||
Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) {
|
||||
return $event->tenant;
|
||||
})->toListener());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue