More specific required check

This commit is contained in:
snipe 2017-09-29 03:44:23 -07:00
parent a4b30279ee
commit 2e76620cf8

View file

@ -47,11 +47,7 @@ class CustomFieldset extends Model
if (($field->field_encrypted!='1') ||
(($field->field_encrypted =='1') && (Gate::allows('admin')) )) {
if ($field->pivot->required) {
$rule[]="required";
} else {
$rule[]="nullable";
}
$rule[] = ($field->pivot->required=='1') ? "required" : "nullable";
}
array_push($rule, $field->attributes['format']);