Upgrade boilerplate
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
@if(empty($name))
|
||||
<code>
|
||||
<x-boilerplate::select2>
|
||||
The name attribute has not been set
|
||||
</code>
|
||||
<code><x-boilerplate::select2> The name attribute has not been set</code>
|
||||
@else
|
||||
<div class="form-group">
|
||||
@isset($label)
|
||||
{{ Form::label($name, __($label)) }}
|
||||
@endisset
|
||||
<select id="{{ $id }}" name="{{ $name }}" class="form-control{{ $errors->first($name,' is-invalid') }}{{ isset($class) ? ' '.$class : '' }}"{!! !empty($attributes) ? ' '.$attributes : '' !!}>
|
||||
<select id="{{ $id }}" name="{{ $name }}" class="form-control{{ $errors->first($name,' is-invalid') }}{{ isset($class) ? ' '.$class : '' }}"{!! !empty($attributes) ? ' '.$attributes : '' !!} style="visibility:hidden;height:1rem">
|
||||
@if(!isset($multiple))
|
||||
<option></option>
|
||||
@endif
|
||||
@if(!empty($options) && is_array($options))
|
||||
@foreach($options as $k => $v)
|
||||
<option value="{{ $k }}"{{ collect($selected ?? [])->contains($k) ? ' selected' : '' }}>{{ $v }}</option>
|
||||
@endforeach
|
||||
@else
|
||||
{{ $slot }}
|
||||
@endisset
|
||||
</select>
|
||||
@if($help ?? false)
|
||||
<small class="form-text text-muted">@lang($help)</small>
|
||||
@@ -28,10 +31,10 @@
|
||||
$('#{{ $id }}').select2({
|
||||
placeholder: '{{ $placeholder ?? '—' }}',
|
||||
allowClear: {{ $allowClear }},
|
||||
language: "{{ config('boilerplate.app.locale') }}",
|
||||
language: "{{ App::getLocale() }}",
|
||||
direction: "@lang('boilerplate::layout.direction')",
|
||||
minimumInputLength: {{ $minimumInputLength ?? 0 }},
|
||||
minimumResultsForSearch: {{ $minimumResultsForSearch ?? 0 }},
|
||||
minimumResultsForSearch: {{ $minimumResultsForSearch ?? 10 }},
|
||||
width: '100%',
|
||||
@isset($ajax)
|
||||
ajax: {
|
||||
|
||||
Reference in New Issue
Block a user