1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-15 10:34:02 +00:00

Compare commits

..

3 commits

Author SHA1 Message Date
66fdf96c1c
[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.
2025-11-25 04:29:46 +01:00
e7f460090f
Syncing: move global ID generation logic to an overridable method
Also make all resource syncing-related listener closures static.

Also correct return type for getGlobalIdentifierKey to string|int.
(We intentionally do not support returning null like many other
"get x key" methods would since such a case might break resource
syncing logic. This is also why we use inline getAttribute() in the
creating listener instead of calling the method.)
2025-11-25 04:15:38 +01:00
lukinovec
628f357f32 Syncing: Add DeleteAllTenantMappings listener 2025-11-25 04:15:38 +01:00

View file

@ -18,8 +18,6 @@ use Stancl\Tenancy\Listeners\QueueableListener;
*/ */
class DeleteAllTenantMappings extends QueueableListener class DeleteAllTenantMappings extends QueueableListener
{ {
public static bool $shouldQueue = false;
/** /**
* Pivot tables to clean up after a tenant is deleted, in the * Pivot tables to clean up after a tenant is deleted, in the
* ['table_name' => 'tenant_key_column'] format. * ['table_name' => 'tenant_key_column'] format.