This commit is contained in:
slong753
2023-07-13 18:36:14 -05:00
committed by spencerrlongg
parent dc39d2c567
commit c1daabef08
4 changed files with 15 additions and 5 deletions
@@ -387,6 +387,9 @@ class AssetsController extends Controller
if ($asset->save()) {
if($asset->wasChanged('purchase_date')){
$model->assets()->whereNotNull('purchase_date')->whereNull('eol_explicit')->update(['asset_eol_date' => DB::raw('DATE_ADD(purchase_date, INTERVAL '.$model->eol.' MONTH)')]);
}
return redirect()->route('hardware.show', $assetId)
->with('success', trans('admin/hardware/message.update.success'));
}