From cc737593b771670ffd3440df10bdec955ecc2558 Mon Sep 17 00:00:00 2001 From: harshjagad20 Date: Thu, 3 Mar 2022 12:55:15 +0530 Subject: [PATCH] Added migration to Change over due status --- ..._063237_change_over_due_status_to_sent.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 database/migrations/2022_03_03_063237_change_over_due_status_to_sent.php diff --git a/database/migrations/2022_03_03_063237_change_over_due_status_to_sent.php b/database/migrations/2022_03_03_063237_change_over_due_status_to_sent.php new file mode 100644 index 00000000..f2d92bc3 --- /dev/null +++ b/database/migrations/2022_03_03_063237_change_over_due_status_to_sent.php @@ -0,0 +1,35 @@ +get(); + + if ($overdueInvoices) { + $overdueInvoices->map(function ($overdueInvoice) { + $overdueInvoice->status = Invoice::STATUS_SENT; + $overdueInvoice->overdue = true; + $overdueInvoice->save(); + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}