diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 8d57346079..1e5d5547e3 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -168,7 +168,6 @@ class AssetModelsController extends Controller } } - if ($model->save()) { return redirect()->route("models.index")->with('success', trans('admin/models/message.update.success')); } @@ -463,6 +462,9 @@ class AssetModelsController extends Controller private function assignCustomFieldsDefaultValues(AssetModel $model, array $defaultValues) { foreach ($defaultValues as $customFieldId => $defaultValue) { + if(is_array($defaultValue)){ + $model->defaultValues()->attach($customFieldId, ['default_value' => implode(',', $defaultValue)]); + } if ($defaultValue) { $model->defaultValues()->attach($customFieldId, ['default_value' => $defaultValue]); } diff --git a/resources/assets/js/components/forms/asset-models/fieldset-default-values.vue b/resources/assets/js/components/forms/asset-models/fieldset-default-values.vue index 9a0e72462d..c84fa36c89 100644 --- a/resources/assets/js/components/forms/asset-models/fieldset-default-values.vue +++ b/resources/assets/js/components/forms/asset-models/fieldset-default-values.vue @@ -45,7 +45,10 @@