Added toggle form helper

This commit is contained in:
Deon George 2022-08-20 23:06:26 +10:00
parent e3ebef90d9
commit 05d3caddf4

View File

@ -0,0 +1,11 @@
<div class="form-group">
<div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
<input type="checkbox" class="custom-control-input" id="{{ $id }}" name="{{ $name ?: $id }}" {{ old($old ?? $name,$value) ? 'checked' : '' }}>
<label class="custom-control-label" for="{{ $id }}">{{ $label }}</label>
</div>
<span class="invalid-feedback @error($id) d-block @enderror" role="alert">
@error($id)
{{ $message }}
@enderror
</span>
</div>