Merge pull request #11003 from inietov/fixes/integrity_constraint_violation_column_order_cannot_be_null_develop

Fixes QueryException Integrity constraint violation: Column 'order' cannot be null for develop
This commit is contained in:
snipe 2022-05-05 13:28:00 -07:00 committed by GitHub
commit 0939591efb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,7 +186,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'));
}