mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 00:24:02 +00:00
Merge branch 'master' of github.com:archtechx/tenancy into unware-feature
This commit is contained in:
commit
b0560331ed
87 changed files with 2308 additions and 533 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(...filesAndFoldersExcluding(['WithoutTenancy'])); // todo move all tests to a separate folder
|
||||
|
||||
|
|
@ -14,4 +18,9 @@ function filesAndFoldersExcluding(array $exclude = []): array
|
|||
$dirs = scandir(__DIR__);
|
||||
|
||||
return array_filter($dirs, fn($dir) => ! in_array($dir, array_merge(['.', '..'], $exclude) , true));
|
||||
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