1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 19:14:03 +00:00

remove getResourceTenantModelName method and use config

This commit is contained in:
Abrar Ahmad 2022-12-02 10:23:26 +05:00
parent b25071323f
commit f99a8222c9
2 changed files with 4 additions and 20 deletions

View file

@ -27,7 +27,9 @@ use Stancl\Tenancy\Tests\Etc\Tenant;
beforeEach(function () {
config(['tenancy.bootstrappers' => [
DatabaseTenancyBootstrapper::class,
]]);
],
'tenancy.tenant_model' => ResourceTenantUsingPolymorphic::class,
]);
Event::listen(TenantCreated::class, JobPipeline::make([CreateDatabase::class])->send(function (TenantCreated $event) {
return $event->tenant;
@ -203,12 +205,6 @@ class CentralUserUsingPolymorphic extends Model implements SyncMaster
public $table = 'users';
// override method to provide different tenant
public function getResourceTenantModelName(): string
{
return ResourceTenantUsingPolymorphic::class;
}
public function getTenantModelName(): string
{
return TenantUserUsingPolymorphic::class;
@ -286,12 +282,6 @@ class CentralCompanyUsingPolymorphic extends Model implements SyncMaster
public $table = 'companies';
// override method to provide different tenant
public function getResourceTenantModelName(): string
{
return ResourceTenantUsingPolymorphic::class;
}
public function getTenantModelName(): string
{
return TenantCompanyUsingPolymorphic::class;