@if($value['type'] == 'text')
{!! Form::text($key, $inputValue, $attributes) !!}
@elseif($value['type'] == 'label')
@php ($attributes['readonly'] = 'true')
@php ($attributes['disabled'] = 'true')
{!! Form::text($key, $inputValue, $attributes) !!}
@elseif($value['type'] == 'email')
@php ($attributes['class'] .= ' disable-autocomplete')
{!! Form::email($key, $inputValue, $attributes) !!}
@elseif($value['type'] == 'number')
{!! Form::number($key, $inputValue, $attributes) !!}
@elseif($value['type'] == 'date')
@php($attributes['class'] .= ' datepicker')
{!! Form::text($key, $inputValue, $attributes) !!}
@elseif($value['type'] == 'time')
@php($attributes['class'] .= ' timepicker')
{!! Form::text($key, $inputValue, $attributes) !!}
@elseif($value['type'] == 'datetime')
@php($attributes['class'] .= ' datetimepicker')
{!! Form::text($key, $inputValue, $attributes) !!}
@elseif($value['type'] == 'password')
@php ($attributes['class'] .= ' disable-autocomplete shhd')
{!! Form::password($key, $attributes) !!}
@elseif($value['type'] == 'textarea')
{!! Form::textarea($key, $inputValue, $attributes) !!}
@elseif($value['type'] == 'editor')
@php ($attributes['class'] .= ' editor')
{!! Form::textarea($key, $inputValue, $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
{!! Form::select($key, $value['options'], $value['value'], $attributes) !!}
@elseif($value['type'] == 'multiselect')
@php ($attributes['multiple'] = 'true')
{!! Form::select($key, $value['options'], $value['value'], $attributes) !!}
@elseif($value['type'] == 'radio')
@foreach($value['options'] as $k => $option)
{{ Form::radio($key, $k, ($value['value'] == $k ? true : false), [
'class' => $key .' custom-control-input',
'id' => $key . '-' . $k
]) }}
@endforeach
@elseif($value['type'] == 'checkbox')
@foreach($value['options'] as $k => $option)
{{ Form::checkbox($key .'[]', $k, ((is_array($value['value']) && in_array($k, $value['value'])) ? true : false), [
'class' => $key .' custom-control-input',
'id' => $key . '-' . $k
]) }}
@endforeach
@elseif($value['type'] == 'switch')
@foreach($value['options'] as $k => $option)
@endforeach
@elseif($value['type'] == 'color')
{!! Form::text($key, $inputValue, $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'])
@if (isset($value['value']))
@foreach ($value['value'] as $f => $file)
@php($file = isset($file['original']) ? $file : \App\Models\File::file($file))
@if (in_array($file['file_mime'], \App\Models\File::$fileValidations['image']['file_mimes']))
@elseif($file['file_mime'])
View File
@endif
@endforeach
@endif
@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\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\File::$fileValidations['image']['file_mimes']))
{{--
--}}
@elseif($value['value']['file_mime'])
@else
{{--
--}}
@endif
{!! Form::file($fileInputName, $attributes) !!}
{{ isset($attributes['placeholder']) ? $attributes['placeholder'] : 'Upload ' . $value['label'] }}
@if (isset($value['help']))
{!! $value['help'] !!}
@endif
@endif
@elseif($value['type'] == 'custom')
{!! $value['value'] !!}
@elseif($value['type'] == 'mobile')
@php ($attributes['data-inputmask'] = "'mask': '(999) 999-9999'")
@php ($attributes['class'] .= " input-mask disable-autocomplete")
{!! Form::text($key, $inputValue, $attributes) !!}
@once
@push('page_script')
@endpush
@endonce
@elseif($value['type'] == 'address')
{!! Form::text($key, $inputValue, $attributes) !!}
{{--
--}}
{{--
--}}
@once
@push('page_script')
@endpush
@endonce
@endif