Updated form helpers, to ensure right hand corners were rounded. Added success_button helper

This commit is contained in:
Deon George 2022-08-06 00:19:20 +10:00
parent 61f38aefe7
commit d494400e7e
4 changed files with 38 additions and 17 deletions

View File

@ -1,9 +1,12 @@
<div class="form-group">
<label for="{{ $id }}">{{ $label }}</label>
<div class="input-group">
<div class="input-group has-validation">
@empty($icon)
@else
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa-fw {{ $icon ?? 'fas fa-calendar' }}"></i></span>
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
</div>
@endempty()
<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)

View File

@ -1,18 +1,32 @@
<div class="form-group">
<label for="{{ $id }}">{{ $label }}</label>
<div class="input-group">
<div class="input-group has-validation">
@empty($icon)
@else
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa-fw {{ $icon ?? 'fas fa-list' }}"></i></span>
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
</div>
@endempty()
<select class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}">
@if(! isset($addvalues) || ! $addvalues)
<option id="new"></option>
@endif
@empty($groupby))
@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
@else
@foreach($options->groupBy($groupby) as $group)
<optgroup label="{{ $groupby == 'active' ? (Arr::get($group->first(),$groupby) ? 'Active' : 'Not Active') : Arr::get($group->first(),$groupby) }}">
@foreach($group 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
</optgroup>
@endforeach
@endempty
</select>
<span class="invalid-feedback" role="alert">

View File

@ -1,9 +1,12 @@
<div class="form-group">
<label for="{{ $id }}">{{ $label }}</label>
<div class="input-group">
<div class="input-group has-validation">
@empty($icon)
@else
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
</div>
@endempty()
<input type="text" class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?: $id }}" value="{{ old($old ?? $name,$value) }}">
<span class="invalid-feedback" role="alert">
@error($id)

View File

@ -0,0 +1 @@
@if(session()->has('success'))<span class="ml-3 pt-0 pb-0 pr-1 pl-1 btn btn-outline-success float-right"><small>{{ session()->get('success') }}</small></span>@endif