@php ($attributes = (isset($value['attributes']) ? $value['attributes'] : [])) @php ($attributes['id'] = (isset($attributes['id']) ? $attributes['id'] : $key)) @php ($attributes['class'] = (isset($attributes['class']) ? $attributes['class'] : 'form-control form-control-lg')) @php ($attributes['class'] .= ($errors->has($key) ? ' is-invalid' : '')) @php ($floatOff = ['select', 'multiselect', 'file', 'radio', 'checkbox', 'editor', 'date', 'custom', 'switch']) @php ($labelWidth = (isset($value['label_width']) ? $value['label_width'] : 'col-lg-3 col-md-3 col-sm-6 col-xs-12 text-right')) @php ($fieldWidth = (isset($value['field_width']) ? $value['field_width'] : 'col-lg-6 col-md-6 col-xs-12 col-sm-12')) @php ($value['value'] = isset($value['value']) ? $value['value'] : null) @if($coverClass)
@endif @if(isset($value['label']) && $value['label'])
@if(isset($value['help']))

{{ $value['help'] }}

@endif
@endif
@if($value['type'] == 'text') {!! html()->text($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'label') @php ($attributes['readonly'] = 'true') @php ($attributes['disabled'] = 'true') {!! html()->text($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'email') {!! html()->email($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'number') {!! html()->number($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'date') @php($attributes['class'] .= ' datepicker') {!! html()->text($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'time') @php($attributes['class'] .= ' timepicker') {!! html()->text($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'datetime') @php($attributes['class'] .= ' datetimepicker') {!! html()->text($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'password') {!! html()->password($key)->attributes($attributes) !!} @elseif($value['type'] == 'textarea') {!! html()->textarea($key, $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'editor') @php ($attributes['class'] .= ' editor') {!! html()->textarea($key, $inputValue)->attributes($attributes) !!} @once @push('page_script') @endpush @endonce @elseif($value['type'] == 'select') @php($attributes['data-live-search'] = "true") @php($attributes['data-size'] = 5) @php($attributes['class'] .= ' live-search') @if(is_array($value['options']) && !empty($value['options'])) @php($value['options'] = ['' => 'Select Option'] + $value['options']) @endif {!! html()->select($key, $value['options'], $value['value'])->attributes($attributes) !!} @elseif($value['type'] == 'multiselect') @php ($attributes['multiple'] = 'true') {!! html()->select($key, $value['options'], $value['value'])->attributes($attributes) !!} @elseif($value['type'] == 'radio')
@foreach($value['options'] as $k => $option)
{{ html() ->radio($key) ->value($k) ->checked($value['value'] == $k ? true : false) ->attributes([ 'class' => $key .' custom-control-input', 'id' => $key . '-' . $k ]) }}
@endforeach
@elseif($value['type'] == 'checkbox')
@foreach($value['options'] as $k => $option)
{{ html() ->checkbox($key .'[]') ->value($k) ->checked((is_array($value['value']) && in_array($k, $value['value'])) ? true : false) ->attributes([ 'class' => $key .' custom-control-input', 'id' => $key . '-' . $k ]) }}
@endforeach
@elseif($value['type'] == 'switch') @foreach($value['options'] as $k => $option)
@endforeach @elseif($value['type'] == 'color')
{!! html()->text($key, $inputValue)->attributes($attributes) !!}
@once @push('page_css') @endpush @push('page_script') @endpush @endonce @elseif($value['type'] == 'dropzone')
@once @push('page_css') @endpush @push('page_script') @endpush @endonce @elseif($value['type'] == 'file') @php ($fileInputName = $key) @if(array_key_exists("cropper", $attributes) && $attributes['cropper']) @php ($cropRatio = (isset($attributes['ratio']) && $attributes['ratio']) ? $attributes['ratio'] : '400x300') @php ($attributes['onclick'] = "readImage(this, '". $cropRatio ."')") @php ($fileInputName .= '_input') @endif @if(!isset($attributes['id'])) @php ($attributes['id'] = $key) @endif @php ($attributes['class'] .= ' custom-file-input') @if(isset($attributes['multiple']) && $attributes['multiple']) @once @push('page_script') @endpush @endonce @else @php($originalFileName = '') @if($value['value'] && isset($value['value']['file_name_original'])) @php($originalFileName = $value['value']['file_name_original']) @endif @php($value['value'] = isset($value['value']['original']) ? $value['value'] : \App\Models\Masters\File::file($value['value'])) @if(array_key_exists("preview", $attributes) && $attributes['preview']) @php ($attributes['onchange'] = "readImage(this)") @endif @if(in_array($value['value']['file_mime'], \App\Models\Masters\File::$fileValidations['image']['file_mimes'])) {{--
--}} @elseif($value['value']['file_mime'])
{{ $originalFileName }} Download
@else {{----}} @endif
{!! html()->file($fileInputName)->attributes($attributes) !!}

{{ isset($attributes['placeholder']) ? $attributes['placeholder'] : "Upload " . $value['label'] }}

@if(isset($value['help'])) {!! $value['help'] !!} @endif
@endif @elseif($value['type'] == 'custom') {!! $value['value'] !!} @endif
@if ($errors->has($key)) @endif
@if($coverClass)
@endif