@foreach($fields as $field)
@php
$value= old('field_'.$field->id);
@endphp
@if($field->type=='text')
required))required @endif type="text" class="form-control" id="{{ 'field_'.$field->id }}" name="{{ 'field_'.$field->id }}" value="{{ $value }}">
@if ($errors->has('field_'.$field->id))
{{ $errors->first('field_'.$field->id) }}
@endif
@elseif($field->type=='select')
{{ Form::select('field_'.$field->id, $selectOptions,$value,['placeholder' => $field->placeholder,'class'=>'form-control']) }}
@if ($errors->has('field_'.$field->id))
{{ $errors->first('field_'.$field->id) }}
@endif
@elseif($field->type=='textarea')
@if ($errors->has('field_'.$field->id))
{{ $errors->first('field_'.$field->id) }}
@endif
@elseif($field->type=='checkbox')
@elseif($field->type=='radio')
{{ $field->name }}
@foreach($radioOptions as $value2)
@endforeach
@elseif($field->type=='file')
required))required @endif type="file" class="form-control" id="{{ 'field_'.$field->id }}" name="{{ 'field_'.$field->id }}" >
@if ($errors->has('field_'.$field->id))
{{ $errors->first('field_'.$field->id) }}
@endif
@endif
@endforeach