Refactoring, change menu, add many features
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
@if (isset($list) && count($list))
|
||||
@foreach($list as $item)
|
||||
<option
|
||||
@if (isset($value) && ($item['id'] == $value)) selected @endif value="{{$item['id']}}"
|
||||
@foreach($item as $item_key => $item_value)
|
||||
@if (($item_key != 'id') && ($item_key != 'txt'))
|
||||
data-{{ $item_key }}="{{ $item_value }}"
|
||||
@endif
|
||||
@endforeach
|
||||
>
|
||||
{{ $item['txt'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -0,0 +1,5 @@
|
||||
@if (($list ?? false) && count($list))
|
||||
@foreach($list as $key => $item)
|
||||
<option @if (isset($values) && in_array($key, $values)) selected @endif value="{{$key}}">{{ $item }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -0,0 +1,5 @@
|
||||
@if (isset($list) && count($list))
|
||||
@foreach($list as $key => $item)
|
||||
<option @if (isset($value) && ($key == $value)) selected @endif value="{{$key}}">{{ $item }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -0,0 +1,7 @@
|
||||
@if (isset($list) && count($list))
|
||||
@foreach($list as $key => $optgroup)
|
||||
<optgroup label="{{ $optgroup['label'] }}">
|
||||
@include('components.form.options', ['list' => $optgroup['options']])
|
||||
</optgroup>
|
||||
@endforeach
|
||||
@endif
|
||||
Reference in New Issue
Block a user