Added form input select, and fixes to date
This commit is contained in:
parent
2e512cc3ed
commit
8e9ca4c531
@ -4,7 +4,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa-fw {{ $icon ?? 'fas fa-calendar' }}"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}" value="{{ old($id,$value) }}">
|
||||
<input type="date" class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}" value="{{ old($old,$value) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error($id)
|
||||
{{ $message }}
|
||||
|
43
resources/themes/adminlte/views/widget/form_select.blade.php
Normal file
43
resources/themes/adminlte/views/widget/form_select.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
<div class="form-group">
|
||||
<label for="{{ $id }}">{{ $label }}</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa-fw {{ $icon ?? 'fas fa-list' }}"></i></span>
|
||||
</div>
|
||||
|
||||
<select class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}">
|
||||
@if(! isset($addvalues) || ! $addvalues)
|
||||
<option id="new"></option>
|
||||
@endif
|
||||
@foreach($options as $option)
|
||||
@empty(Arr::get($option,'value')) @continue @endempty
|
||||
<option value="{{ Arr::get($option,'id') }}" @if(Arr::get($option,'id') == old($old,$value))selected @endif>{{ Arr::get($option,'value') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error($id)
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('page-scripts')
|
||||
@css(select2)
|
||||
@js(select2,autofocus)
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#{{ $id }}').select2({
|
||||
dropdownAutoWidth: true,
|
||||
width: 'style',
|
||||
@isset($addvalues)
|
||||
tags: true,
|
||||
placeholder: '',
|
||||
allowClear: true,
|
||||
@endisset
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
Loading…
Reference in New Issue
Block a user