From 69e37ffa300fb1ce00d50910e7a68b262b9f3292 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 21 Oct 2022 15:03:23 +0200 Subject: [PATCH] Dynamically get virtual column name in ClearPendingTenants --- src/Commands/ClearPendingTenants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/ClearPendingTenants.php b/src/Commands/ClearPendingTenants.php index db2e0ef5..0a7782c4 100644 --- a/src/Commands/ClearPendingTenants.php +++ b/src/Commands/ClearPendingTenants.php @@ -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