diff --git a/app/Http/Controllers/CustomFieldsetsController.php b/app/Http/Controllers/CustomFieldsetsController.php index c8138d4466..075d534a16 100644 --- a/app/Http/Controllers/CustomFieldsetsController.php +++ b/app/Http/Controllers/CustomFieldsetsController.php @@ -172,7 +172,7 @@ class CustomFieldsetsController extends Controller * @since [v1.8] * @return View */ - public function associate($id) + public function associate(Request $request, $id) { $set = CustomFieldset::find($id); @@ -180,12 +180,12 @@ class CustomFieldsetsController extends Controller $this->authorize('update', $set); foreach ($set->fields as $field) { - if ($field->id == Input::get('field_id')) { + if ($field->id == $request->input('field_id')) { return redirect()->route("fieldsets.show", [$id])->withInput()->withErrors(['field_id' => trans('admin/custom_fields/message.field.already_added')]); } } - $results=$set->fields()->attach(Input::get('field_id'), ["required" => (Input::get('required') == "on"),"order" => Input::get('order')]); + $results = $set->fields()->attach(Input::get('field_id'), ["required" => ($request->input('required') == "on"),"order" => $request->input('order', 1)]); return redirect()->route("fieldsets.show", [$id])->with("success", trans('admin/custom_fields/message.field.create.assoc_success')); }