where('expires_at IS NOT NULL') ->where('expires_at < NOW()') ->findAll(); if (empty($expired)) { CLI::write("ℹ No expired notifications found to soft delete.", 'yellow'); return; } $count = 0; foreach ($expired as $note) { $model->delete($note['id']); // Soft delete $count++; } CLI::write("✅ Soft-deleted {$count} expired notifications.", 'green'); } }