Properly select 'CUSTOM REGEX' from the select list if the format declares onee

This commit is contained in:
Ivan Nieto Vivanco 2022-11-30 16:21:23 -06:00
parent cfc4229308
commit 8d36971c8b

View file

@ -74,8 +74,14 @@
<label for="format" class="col-md-4 control-label">
{{ trans('admin/custom_fields/general.field_format') }}
</label>
@php
$field_format = '';
if (stripos($field->format, 'regex') === 0){
$field_format = 'CUSTOM REGEX';
}
@endphp
<div class="col-md-6 required">
{{ Form::select("format",Helper::predefined_formats(), $field->format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }}
{{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }}
{!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>