mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Check for uniqueness constraint
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
41778980bc
commit
6a91d4d19e
|
@ -83,7 +83,11 @@ class CustomFieldset extends Model
|
||||||
|
|
||||||
if (($field->field_encrypted != '1') ||
|
if (($field->field_encrypted != '1') ||
|
||||||
(($field->field_encrypted == '1') && (Gate::allows('admin')))) {
|
(($field->field_encrypted == '1') && (Gate::allows('admin')))) {
|
||||||
$rule[] = ($field->pivot->required == '1') ? 'required' : 'nullable';
|
$rule[] = ($field->pivot->required == '1') ? 'required' : 'nullable';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($field->is_unique == '1') {
|
||||||
|
$rule[] = 'unique';
|
||||||
}
|
}
|
||||||
|
|
||||||
array_push($rule, $field->attributes['format']);
|
array_push($rule, $field->attributes['format']);
|
||||||
|
|
Loading…
Reference in a new issue