mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 21:54:03 +00:00
[MINOR BC BREAK] Syncing: PivotWithRelation -> PivotWithCentralResource
The old names of the class and method were misleading. We don't actually need any relation. And we don't even need a model instance as we were returning previously -- the only use of that method was in TriggerSyncingEvents which would immediately use ::class on the returned value. Therefore, all we are asking for in this interface is just the central resource class.
This commit is contained in:
parent
e7f460090f
commit
66fdf96c1c
6 changed files with 23 additions and 34 deletions
|
|
@ -263,7 +263,7 @@ test('attaching central resources to tenants or vice versa creates synced tenant
|
|||
expect(TenantUser::all())->toHaveCount(0);
|
||||
});
|
||||
|
||||
// Attaching resources to tenants requires using a pivot that implements the PivotWithRelation interface
|
||||
// Attaching resources to tenants requires using a pivot that implements the PivotWithCentralResource interface
|
||||
$tenant->customPivotUsers()->attach($createCentralUser());
|
||||
$createCentralUser()->tenants()->attach($tenant);
|
||||
|
||||
|
|
@ -287,7 +287,7 @@ test('detaching central users from tenants or vice versa force deletes the synce
|
|||
migrateUsersTableForTenants();
|
||||
|
||||
if ($attachUserToTenant) {
|
||||
// Attaching resources to tenants requires using a pivot that implements the PivotWithRelation interface
|
||||
// Attaching resources to tenants requires using a pivot that implements the PivotWithCentralResource interface
|
||||
$tenant->customPivotUsers()->attach($centralUser);
|
||||
} else {
|
||||
$centralUser->tenants()->attach($tenant);
|
||||
|
|
@ -298,7 +298,7 @@ test('detaching central users from tenants or vice versa force deletes the synce
|
|||
});
|
||||
|
||||
if ($attachUserToTenant) {
|
||||
// Detaching resources from tenants requires using a pivot that implements the PivotWithRelation interface
|
||||
// Detaching resources from tenants requires using a pivot that implements the PivotWithCentralResource interface
|
||||
$tenant->customPivotUsers()->detach($centralUser);
|
||||
} else {
|
||||
$centralUser->tenants()->detach($tenant);
|
||||
|
|
@ -333,7 +333,7 @@ test('detaching central users from tenants or vice versa force deletes the synce
|
|||
});
|
||||
|
||||
if ($attachUserToTenant) {
|
||||
// Detaching resources from tenants requires using a pivot that implements the PivotWithRelation interface
|
||||
// Detaching resources from tenants requires using a pivot that implements the PivotWithCentralResource interface
|
||||
$tenant->customPivotUsers()->detach($centralUserWithSoftDeletes);
|
||||
} else {
|
||||
$centralUserWithSoftDeletes->tenants()->detach($tenant);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue