@endif
@php($requestParam = Request::all())
@if(isset($form['route_param']) && $form['route_param'])
@php($requestParam = array_merge($requestParam, $form['route_param']))
@endif
@php($formRequired = (!isset($form['form_required']) || (isset($form['form_required']) && $form['form_required'])) ? true : false)
@php($formClass = $form['class'] ?? 'form-horizontal custom-validation' )
@php($formId = $form['id'] ?? 'admin-form')
@php($topRightButtons = [])
@php($otherButtons = [])
@php($otherButtonsBL = [])
@if(isset($form['custom_buttons']))
@foreach($form['custom_buttons'] as $button)
@if(isset($button['attributes']['position']) && $button['attributes']['position'] === 'tr')
@php($topRightButtons[] = $button)
@elseif(isset($button['attributes']['position']) && $button['attributes']['position'] === 'bl')
@php($otherButtonsBL[] = $button)
@else
@php($otherButtons[] = $button)
@endif
@endforeach
@endif
@php(
$qa = $form['quick_add'] ?? null
)
@php(
$qaShow = is_array($qa) ? ($qa['show'] ?? (bool)$qa) : (bool)$qa
)
@php(
$qaPos = is_array($qa) ? ($qa['position'] ?? 'top') : 'top'
)
@php(
$qaVal = is_array($qa) ? ($qa['value'] ?? '') : ''
)
@php(
$qaChecked = old('is_make_another_field', $qaVal) ? 'checked' : ''
)
@php(
$qaContainerClass = 'custom-control custom-checkbox project-checkbox' . ($qaPos === 'bottom' ? ' mb-3' : '')
)
@php(
$quickAddCheckboxHtml = $qaShow
? '
'
: ''
)
@if($formRequired)
@if(isset($id) && $id)
@php($requestParam[] = $id)
@php($formAttributes = [
'class' => $formClass,
'enctype' => 'multipart/form-data',
'data-method' => 'POST',
'id' => $formId,
'data-refresh' => (isset($form['attributes']['data-refresh']) ? $form['attributes']['data-refresh'] : null)
])
@if(isset($form['attributes']))
@php($formAttributes = array_merge($formAttributes, $form['attributes']))
@endif
{{ html()->modelForm($data, 'PATCH', isset($form['route']) && $form['route'] ? route($form['route'], $requestParam) : '#')
->attributes($formAttributes)
->open() }}
@else
@php($formAttributes = [
'class' => $formClass,
'enctype' => 'multipart/form-data',
'data-method' => 'POST',
'id' => $formId,
'data-refresh' => (isset($form['attributes']['data-refresh']) ? $form['attributes']['data-refresh'] : null)
])
@if(isset($form['attributes']))
@php($formAttributes = array_merge($formAttributes, $form['attributes']))
@endif
{!! html()
->form('POST', isset($form['route']) && $form['route'] ? route($form['route'], $requestParam) : '#')
->attributes($formAttributes)
->open() !!}
@endif
@endif
@if(isset($form['label']) && $form['label'] != '' || count($topRightButtons) > 0)
@endif
@if(count($topRightButtons))
{!! ($qaShow && $qaPos === 'top') ? $quickAddCheckboxHtml : '' !!}
@if(isset($form['back_route']) && $form['back_route']!= '')
Back
@endif
@foreach($topRightButtons as $button)
@if(isset($button['type']) && $button['type'] == 'anchor')
@if(isset($button['icon']))
@endif
{!! $button['text'] !!}
@else
@endif
@endforeach
@endif
@if(isset($form['label']) && $form['label'] != '' || count($topRightButtons) > 0)
@endif
@if(!empty($form['fields']))
@php ($multiSelectScript = 0)
@php ($dateTimePicker = 0)
@php ($fileCropper = 0)
@php ($rowClass = 'form-group row')
@foreach($form['fields'] as $key => $value)
@if(isset($value['attributes']['second_panel']))
@continue
@endif
@if(isset($value['row_width']))
@php ($rowClass = $value['row_width'])
@php ($oneElementEachRow = false)
@else
@php ($rowClass = 'form-group row')
@php ($oneElementEachRow = true)
@endif
@php ($extraWidth = (isset($value['extra']['field_width']) ? $value['extra']['field_width'] : 'col-lg-3 col-md-6 col-xs-12 col-sm-12'))
@php ($dateTimePicker = (!$dateTimePicker && in_array($value['type'], ['date', 'time', 'datetime'])) ? 1 : $dateTimePicker)
@php ($fileCropper = (!$fileCropper && (($value['type'] == 'file' && isset($value['attributes']) && array_key_exists("cropper", $value['attributes']) && $value['attributes']['cropper']) || ($value['type'] == 'dropzone' && isset($value['attributes']) && array_key_exists("cropper", $value['attributes']) && $value['attributes']['cropper']))) ? 1 : $fileCropper)
@php ($coverClass = '')
@php ($inputValue = (isset($value['value']) ? $value['value'] : null))
@php ($inputGroup = null)
@if(isset($value['input_group']))
@php($inputGroup = $value['input_group'])
@dd($inputGroup)
@endif
@if(!in_array($value['type'], ['html', 'include', 'hidden', 'group']))
@include('admin.components.admin-form-field')
@if(isset($value['extra']) && $value['extra'])
@endif
@elseif($value['type'] == 'group')
@php($groupWidth = $value['width'] ?? 'col-xl-3 col-md-6 col-sm-6 col-xs-12')
@php($groupRowClass = $value['row_width'] ?? 'row')
@php($groupRowClass .= (isset($value['background_color']) && $value['background_color']) ? ' form-group-background' : '')
@php($saperateLine = isset($value['seperator_line']) && $value['seperator_line'] ? true : false)
@if(isset($value['label']) && !empty($value['label']))
{{ $value['label'] }}
@endif
@if(isset($value['sub_label']) && !empty($value['sub_label']))
@endif
@foreach($value['fields'] as $k => $v)
@php($groupWidth = $v['width'] ?? $groupWidth)
@endforeach
@if($saperateLine)
@endif
@elseif($value['type'] == 'hidden')
{!! html()->hidden($key, $inputValue, ($value['attributes'] ?? [])) !!}
@elseif($value['type'] == 'html')
@if(isset($value['label']) && !empty($value['label']))
@endif
{!! $value['value'] !!}
@elseif($value['type'] == 'include')
@include($value['value'])
@endif
@endforeach
@if($dateTimePicker)
@include('admin.components.date-time-picker')
@endif
@if($fileCropper)
@push('page_css')
@endpush
@push('page_script')
@endpush
@endif
@endif
@if(isset($include_page))
@include($include_page)
@endif
@if($formRequired)
{!! html()->form()->close() !!}
@else
@endif
@if(isset($form['wrapper']) && $form['wrapper'])