@php $widthColumn=0; $openRow = false; @endphp @if( isset($mode) == 'table' ) @foreach( $data as $input ) @if( $input['type'] != 'hidden' ) @endif @endforeach @endif @php $l = 1; @endphp @foreach( $data as $i => $input ) @php if( $input['type'] == 'hidden' ) continue; $more = []; $more["autocomplete"] = 'off'; if( isset($input['placeholder']) ) $more['placeholder'] = $input['placeholder']; $more["class"] = " "; if( isset($input["class"]) ){ $more["class"] .= $input["class"]; } $more["id"] = isset($mode) == 'table' ? $input['name'].'_'.$l : $input['name']; $input['name'] = isset($mode) == 'table' ? $input['name']."[]" : $input['name']; if( $input['required'] ) $more["required"] = "required"; $col = $input["col"]; if( $col > 12 ){ $widthColumn = 0; $col = 12; } $widthColumn += $col; @endphp @if( !$openRow && isset($mode) != 'table' )
@php $openRow = true; if( $input['hidden'] == 'yes' ) continue; @endphp @endif @if( isset($mode) == 'table' )
@else @endif @if( $widthColumn >= 12 && isset($mode) != 'table') @php $openRow = false; $widthColumn = 0; @endphp @endif @endforeach @if( $openRow && isset($mode) != 'table') @endif @if( isset($mode) == 'table' )
{{$input['label']}}
@else
@if( isset($input['label']) && $input['label'])@endif @endif @switch( $input['type'] ) @case('text') {!!Form::text($input['name'], $input['value'], $more)!!} @break @case('number') {!!Form::number($input['name'], $input['value'], $more)!!} @break @case('email') {!!Form::email($input['name'], $input['value'], $more)!!} @break @case('date') {!!Form::date($input['name'], \Carbon\Carbon::now(),$more)!!} @break @case('textarea') {!!Form::textarea($input['name'], $input['value'], $more )!!} @break @case('file') {!!Form::file($input['name'])!!} @break @case('select') @php $options = []; if(!isset($input['placeholder'])) { $options = ['' => '']; } foreach( $input['options'] as $o ){ $options[$o->value] = $o->text; } @endphp {!!Form::select($input['name'], $options, $input['value'], $more )!!} @break @case('radio') @php $options = []; if(!isset($input['placeholder'])) { $options = ['' => '']; } foreach( $input['options'] as $o ){ $options[$o['value']] = $o['text']; } @endphp {!!Form::select($input['name'], $options, $input['value'], $more )!!} @break @endswitch @if( isset($mode) == 'table' )
@endif