mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 15:54:03 +00:00
use correct key
This commit is contained in:
parent
dc69a112eb
commit
4bdcf64c20
2 changed files with 6 additions and 5 deletions
|
|
@ -48,7 +48,7 @@ trait ResourceSyncing
|
||||||
|
|
||||||
public function tenants(): MorphToMany
|
public function tenants(): MorphToMany
|
||||||
{
|
{
|
||||||
return $this->morphToMany(config('tenancy.tenant_model'), 'tenant_resources', 'tenant_resources', 'resource_global_id', 'tenant_id', 'global_id')
|
return $this->morphToMany(config('tenancy.models.tenant'), 'tenant_resources', 'tenant_resources', 'resource_global_id', 'tenant_id', 'global_id')
|
||||||
->using(TenantMorphPivot::class);
|
->using(TenantMorphPivot::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,11 @@ use Stancl\Tenancy\Listeners\UpdateSyncedResource;
|
||||||
use Stancl\Tenancy\Tests\Etc\Tenant;
|
use Stancl\Tenancy\Tests\Etc\Tenant;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
config(['tenancy.bootstrappers' => [
|
config([
|
||||||
DatabaseTenancyBootstrapper::class,
|
'tenancy.bootstrappers' => [
|
||||||
],
|
DatabaseTenancyBootstrapper::class,
|
||||||
'tenancy.tenant_model' => ResourceTenantUsingPolymorphic::class,
|
],
|
||||||
|
'tenancy.models.tenant' => ResourceTenantUsingPolymorphic::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) {
|
Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue