subHours(MiniPayment::STALE_PENDING_HOURS); $count = MiniPayment::query() ->where('status', MiniPayment::STATUS_PENDING) ->where('created_at', '<', $cutoff) ->update([ 'status' => MiniPayment::STATUS_CANCELED, 'updated_at' => now(), ]); $this->info("Canceled {$count} stale pending payment(s)."); return self::SUCCESS; } }