mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 04:34:02 +00:00
remove getResourceTenantModelName method and use config
This commit is contained in:
parent
b25071323f
commit
f99a8222c9
2 changed files with 4 additions and 20 deletions
|
|
@ -7,7 +7,6 @@ namespace Stancl\Tenancy\Database\Concerns;
|
|||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Stancl\Tenancy\Contracts\Syncable;
|
||||
use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator;
|
||||
use Stancl\Tenancy\Database\Models\Tenant;
|
||||
use Stancl\Tenancy\Database\Models\TenantMorphPivot;
|
||||
use Stancl\Tenancy\Events\SyncedResourceSaved;
|
||||
|
||||
|
|
@ -49,12 +48,7 @@ trait ResourceSyncing
|
|||
|
||||
public function tenants(): MorphToMany
|
||||
{
|
||||
return $this->morphToMany($this->getResourceTenantModelName(), 'tenant_resources', 'tenant_resources', 'resource_global_id', 'tenant_id', 'global_id')
|
||||
return $this->morphToMany(config('tenancy.tenant_model'), 'tenant_resources', 'tenant_resources', 'resource_global_id', 'tenant_id', 'global_id')
|
||||
->using(TenantMorphPivot::class);
|
||||
}
|
||||
|
||||
public function getResourceTenantModelName(): string // todo better name
|
||||
{
|
||||
return config('tenancy.tenant_model', Tenant::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue