From 321e7c93ec04c454a406f57b3380d9dc00fa1077 Mon Sep 17 00:00:00 2001 From: slong753 Date: Thu, 13 Jul 2023 01:02:01 -0500 Subject: [PATCH] carbon thing --- ...malized_eol_and_add_column_for_explicit_date_to_assets.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index 8975eeeba5..77f42696f7 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -1,5 +1,6 @@ eol; if ($eol) { - $asset_eol_date = date('Y-m-d', strtotime($asset->asset_purchase_date . ' + ' . $eol . ' months')); + //getting rid of the weird date($asset->asset_purchase_date, strtotime('+'.$eol.' months') thing because it was weird + $asset_eol_date = Carbon::parse($asset->asset_purchase_date)->addMonths($eol)->format('Y-m-d'); DB::table('assets')->where('id', $asset->id)->update(['asset_eol_date' => $asset_eol_date]); } }