diff --git a/app/Http/Controllers/CustomFieldsController.php b/app/Http/Controllers/CustomFieldsController.php index d73f544af4..9b74c040d1 100644 --- a/app/Http/Controllers/CustomFieldsController.php +++ b/app/Http/Controllers/CustomFieldsController.php @@ -166,13 +166,13 @@ class CustomFieldsController extends Controller public function update(CustomFieldRequest $request, $id) { $field = CustomField::find($id); - $field->name = e($request->get("name")); $field->element = e($request->get("element")); $field->field_values = e($request->get("field_values")); $field->field_encrypted = e($request->get("field_encrypted", 0)); $field->user_id = Auth::user()->id; $field->help_text = $request->get("help_text"); + $field->show_in_email = $request->get("show_in_email", 0); if (!in_array(Input::get('format'), array_keys(CustomField::$PredefinedFormats))) { $field->format = e($request->get("custom_format")); @@ -180,7 +180,6 @@ class CustomFieldsController extends Controller $field->format = e($request->get("format")); } - if ($field->save()) { return redirect()->route("fields.index")->with("success", trans('admin/custom_fields/message.field.update.success')); } diff --git a/app/Models/CustomField.php b/app/Models/CustomField.php index c59483dcc6..ad9a2ab36a 100644 --- a/app/Models/CustomField.php +++ b/app/Models/CustomField.php @@ -41,7 +41,8 @@ class CustomField extends Model 'format', 'field_values', 'field_encrypted', - 'help_text' + 'help_text', + 'show_in_email', ]; // This is confusing, since it's actually the custom fields table that diff --git a/resources/views/custom_fields/fields/edit.blade.php b/resources/views/custom_fields/fields/edit.blade.php index 282328b5a1..ea33cd2f07 100644 --- a/resources/views/custom_fields/fields/edit.blade.php +++ b/resources/views/custom_fields/fields/edit.blade.php @@ -102,19 +102,21 @@ + +
+
+ +
+ +
+ @if (!$field->id) - -
-
- -
-