@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'])
@if(isset($value['value']))
@foreach($value['value'] as $f => $file)
@php($file = isset($file['original']) ? $file : \App\Models\Masters\File::file($file))
@if(in_array($file['file_mime'], \App\Models\Masters\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\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'])
@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