diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index d514da7b0b..6673624fc3 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -85,7 +85,7 @@ class AssetModelsController extends Controller $model->fieldset_id = e($request->input('custom_fieldset')); } - $model = $request->handleImages($model,600, public_path().'/uploads/models'); + $model = $request->handleImages($model,600,null,null, public_path().'/uploads/models'); // Was it created? if ($model->save()) { @@ -143,6 +143,8 @@ class AssetModelsController extends Controller return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist')); } + $model = $request->handleImages($model); + $model->depreciation_id = $request->input('depreciation_id'); $model->eol = $request->input('eol'); $model->name = $request->input('name'); @@ -152,6 +154,8 @@ class AssetModelsController extends Controller $model->notes = $request->input('notes'); $model->requestable = $request->input('requestable', '0'); + + $this->removeCustomFieldsDefaultValues($model); if ($request->input('custom_fieldset')=='') { @@ -164,7 +168,6 @@ class AssetModelsController extends Controller } } - $model = $request->handleImages($model,600, public_path().'/uploads/models'); if ($model->save()) { return redirect()->route("models.index")->with('success', trans('admin/models/message.update.success'));