fix conflicts

This commit is contained in:
slong753 2023-07-18 10:54:51 -05:00 committed by spencerrlongg
parent 5948679a4a
commit 75d7e3e1a0
2 changed files with 5 additions and 3 deletions

View file

@ -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'));

View file

@ -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;