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

Fix ClearPendingTenants bug

This commit is contained in:
lukinovec 2022-10-21 15:21:20 +02:00
parent 69e37ffa30
commit c3fb301f9d

View file

@ -62,7 +62,7 @@ class ClearPendingTenants extends Command
->query()
->onlyPending()
->when($originalExpirationDate->notEqualTo($expirationDate), function (Builder $query) use ($expirationDate) {
$query->where($query->getModel('pending_since'), '<', $expirationDate->timestamp);
$query->where($query->getModel()->getColumnForQuery('pending_since'), '<', $expirationDate->timestamp);
})
->get()
->each // Trigger the model events by deleting the tenants one by one