From 90d3a6f8e64ad2911530e2ea393cfab70746fcf7 Mon Sep 17 00:00:00 2001 From: "noah.lancien" Date: Thu, 6 Apr 2023 08:56:20 +0000 Subject: [PATCH] Created migration to change actual status --- ...023_04_06_101917_change_tickets_status.php | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 database/migrations/2023_04_06_101917_change_tickets_status.php diff --git a/database/migrations/2023_04_06_101917_change_tickets_status.php b/database/migrations/2023_04_06_101917_change_tickets_status.php new file mode 100644 index 0000000..d3a685d --- /dev/null +++ b/database/migrations/2023_04_06_101917_change_tickets_status.php @@ -0,0 +1,53 @@ +get(); + collect($tickets)->map(function (object $ticket) { + switch ($ticket->status) { + case 3: + DB::table('tickets')->where('id', $ticket->id) + ->update(['status' => 18]); + break; + case 4: + DB::table('tickets')->where('id', $ticket->id) + ->update(['status' => 18]); + break; + case 5: + DB::table('tickets')->where('id', $ticket->id) + ->update(['status' => 18]); + break; + case 7: + DB::table('tickets')->where('id', $ticket->id) + ->update(['status' => 18]); + break; + case 10: + DB::table('tickets')->where('id', $ticket->id) + ->update(['status' => 13]); + break; + default: + break; + } //end switch + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}