@foreach($setting as $key => $value)
@foreach($value as $sub_key => $sub_value)
@php
$data = null;
foreach($setting_value as $v) {
if ($v->key == $sub_key) {
$data = $v;
}
}
$type = 'number';
@endphp
{!! html()->hidden('type[]', $sub_key) !!}
{!! html()->hidden('key[]', $sub_key) !!}
@if($key == 'insurance')
{!! html()->hidden('value['.$loop->index.']', 0) !!}
{!! html()->checkbox('value['.$loop->index.']', 1)->checked(isset($data) && $data->value == 1)->class('custom-control-input bg-success float-right')->id($sub_key) !!}
{!! html()->label(__('message.' . $sub_key))->for($sub_key)->class('custom-control-label') !!}
@elseif($key == 'insurance_percentage')
{!! html()->label(__('message.' . $sub_key) . ' *')->for($sub_key)->class('control-label') !!}
{!! html()->input($type, 'value[]', isset($data) ? $data->value : null)
->class('form-control form-control-lg')
->placeholder(str_replace('_', ' ', $sub_key))
->attributes($type == 'number' ? ['min' => 0, 'max' => 100, 'step' => 'any'] : [])
->required() !!}
@elseif($key == 'insurance_description')
@php
$description = isset($data) ? App\Models\Pages::find($data->value) : null;
@endphp
{!! html()->label(__('message.insurance_page'))->for('insurance_page')->class('control-label') !!}
{!! html()->select('value[]', isset($description) ? [$description->id => $description->title] : [])
->class('select2js form-group insurance_page')
->attribute('data-placeholder', __('message.insurance_page'))
->attribute('data-ajax--url', route('ajax-list', ['type' => 'page-list']))
->required() !!}
@elseif($key == 'claim_duration')
{!! html()->label(__('message.' . $sub_key))->for($sub_key)->class('control-label') !!}
{!! html()->input($type, 'value[]', isset($data) ? $data->value : null)
->class('form-control form-control-lg')
->placeholder(str_replace('_', ' ', $sub_key))
->attributes($type == 'number' ? ['min' => 0, 'max' => 100, 'step' => 'any', 'oninput' => 'checkValue(this)'] : ['oninput' => 'checkValue(this)']) !!}
@endif
@endforeach
@endforeach