Adds an integer casting to the order input field so it cannot be null

This commit is contained in:
Ivan Nieto Vivanco 2022-05-01 15:16:56 -05:00
parent 5a8c3444e2
commit 01232d9a54

View file

@ -195,7 +195,7 @@ class CustomFieldsetsController extends Controller
}
}
$results = $set->fields()->attach($request->input('field_id'), ["required" => ($request->input('required') == "on"),"order" => $request->input('order', 1)]);
$results = $set->fields()->attach($request->input('field_id'), ["required" => ($request->input('required') == "on"),"order" => (int)$request->input('order', 1)]);
return redirect()->route("fieldsets.show", [$id])->with("success", trans('admin/custom_fields/message.field.create.assoc_success'));
}