From 75d7e3e1a01b40902620193e4b4aae2ba3e1b704 Mon Sep 17 00:00:00 2001 From: slong753 Date: Tue, 18 Jul 2023 10:54:51 -0500 Subject: [PATCH] fix conflicts --- app/Http/Controllers/Assets/AssetsController.php | 3 ++- app/Models/Asset.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index 302131d45c..50e45fc91f 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -394,7 +394,8 @@ class AssetsController extends Controller if ($asset->save()) { if($asset->wasChanged('purchase_date') && $asset->eol_explicit == false){ - $asset->asset_eol_date = Carbon::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d'); + $asset_eol_date = Carbon::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d'); + $asset->update(['asset_eol_date' => $asset_eol_date]); } return redirect()->route('hardware.show', $assetId) ->with('success', trans('admin/hardware/message.update.success')); diff --git a/app/Models/Asset.php b/app/Models/Asset.php index e43152cd36..946505d20f 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -107,7 +107,8 @@ class Asset extends Depreciable 'serial' => 'unique_serial|nullable', 'purchase_cost' => 'numeric|nullable|gte:0', 'supplier_id' => 'exists:suppliers,id|nullable', - 'asset_eol_date' => 'date_format:Y-m-d|nullable', + //something not working here... + // 'asset_eol_date' => 'date_format:Y-m-d|nullable', 'eol_explicit' => 'boolean|nullable', 'byod' => 'boolean', ]; @@ -142,7 +143,7 @@ class Asset extends Depreciable 'asset_eol_date', 'last_audit_date', 'next_audit_date', - 'eol_explicit', + 'eol_explicit', ]; use Searchable;