@if(!empty($form->schema['form']))
@foreach($form->schema['form'] as $key => $element) @php $custom_attributes = isset($element['custom_attributes']) ? $element['custom_attributes'] : []; @endphp
@if($element['type'] == 'text')
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
@endif $custom_attributes]) > @if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
@endif
@if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif($element['type'] == 'range')
{{$element['min']}}
$custom_attributes])>
{{$element['max']}}
@if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif($element['type'] == 'calendar')
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
@endif $custom_attributes]) > @if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
@endif
@if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif($element['type'] == 'textarea')
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
@endif @if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
@endif
@if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif(in_array($element['type'], ['radio', 'checkbox']))
@foreach(explode(PHP_EOL, $element['options']) as $option)
$custom_attributes]) >
@endforeach @if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif($element['type'] == 'dropdown')
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
@endif @if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
@endif
@if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif($element['type'] == 'heading')
@php echo '<' . $element['tag'] . ' style="color:' . $element['text_color'] . '">' . $element['content'] .''; @endphp
@elseif($element['type'] == 'file_upload')
$custom_attributes])>
@if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif($element['type'] == 'text_editor')
@if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif($element['type'] == 'terms_and_condition')
$custom_attributes])>
@elseif($element['type'] == 'hr')
@elseif($element['type'] == 'html_text')
{!!$element['html_text']!!}
@elseif($element['type'] == 'rating')
@elseif($element['type'] == 'switch')
$custom_attributes]) data-msg-required="{{$element['required_error_msg']}}"> @if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif($element['type'] == 'signature')
$custom_attributes])>
{{__('messages.clear')}} {{__('messages.undo')}} @if(!empty($element['help_text'])) {{$element['help_text']}} @endif
@elseif(($element['type'] == 'youtube') && !empty($element['iframe_url'])) @php $video_id = ''; $url = $element['iframe_url']; if (str_contains($url, 'watch')) { $video_id = str_replace('https://www.youtube.com/watch?v=', '', $url); } else if (str_contains($url, 'youtu.be')) { $video_id = str_replace('https://youtu.be/', '', $url); } else if (str_contains($url, 'embed')) { $video_id = str_replace('https://www.youtube.com/embed/', '', $url); } $yt_embed_url = "https://www.youtube.com/embed/{$video_id}"; @endphp
@elseif(($element['type'] == 'iframe') && !empty($element['iframe_url']))
@elseif(($element['type'] == 'pdf') && !empty($element['pdf']))
@elseif($element['type'] == 'countdown')
@endif
@endforeach
@endif