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

Dynamically get virtual column name in ClearPendingTenants

This commit is contained in:
lukinovec 2022-10-21 15:03:23 +02:00
parent 789a05b125
commit 69e37ffa30

View file

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