company->db); $this->company ->invoices() ->where('is_deleted', 0) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->cursor() ->each(function ($invoice) { $invoice->service()->setReminder()->save(); }); } }