@if (isset($filters) && !empty($filters)) @php($floatOff = ['select', 'multiselect', 'file', 'radio', 'checkbox', 'editor', 'date', 'custom', 'switch']) @php($dateTimePicker = 0)
@foreach ($filters['fields'] as $key => $value) @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') @php($inputValue = isset($value['value']) && $value['value'] ? $value['value'] : \Request::input($key)) @php($dateTimePicker = !$dateTimePicker && in_array($value['type'], ['date', 'time', 'datetime']) ? 1 : $dateTimePicker) @if (!in_array($value['type'], ['html', 'include', 'hidden']))
@if ($value['type'] == 'text') {!! 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'] == 'select') @php($attributes['data-live-search'] = 'true') @php($attributes['data-size'] = 5) @if (is_array($value['options']) && !empty($value['options'])) @php($value['options'] = ['' => 'Select Option'] + $value['options']) @endif {!! html()->select($key, $value['options'], $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'custom_select') @php($attributes['data-live-search'] = 'true') @php($attributes['data-size'] = 5) @if (is_array($value['options']) && !empty($value['options'])) @php($value['options'] = $value['options']) @endif {!! html()->select($key, $value['options'], $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'multiselect') @php($attributes['multiple'] = 'true') {!! html()->select($key, $value['options'], $inputValue)->attributes($attributes) !!} @elseif($value['type'] == 'radio')
@foreach ($value['options'] as $k => $option)
@endforeach
@elseif($value['type'] == 'checkbox')
@foreach ($value['options'] as $k => $option)
@endforeach
@elseif($value['type'] == 'switch') @foreach ($value['options'] as $k => $option)
@endforeach @elseif($value['type'] == 'custom') {!! $inputValue !!} @elseif($value['type'] == 'daterange') @once {{-- @push('page_css') --}} {{-- @endpush --}} {!! html()->text($key, $inputValue)->attributes($attributes) !!} @push('page_script') @endpush @endonce @push('page_script') @endpush @endif
@elseif($value['type'] == 'hidden') {!! html()->hidden($key, $inputValue) !!} @endif @endforeach
@if ($dateTimePicker) @include('admin.components.date-time-picker') @endif @endif