leenooks/resources/components/form/toggle.blade.php

17 lines
626 B
PHP
Raw Normal View History

2024-07-23 13:50:02 +00:00
<div class="form-group">
<div class="input-group has-validation">
<div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
<input type="checkbox" class="custom-control-input @error($name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" @checked(old($name,$value ?? ''))>
@if(isset($label))
<label class="custom-control-label" for="{{ $id ?? $name }}">{{ $label }}</label>
@endif
</div>
<span class="invalid-feedback" role="alert">
@error($name)
{{ $message }}
@elseif(isset($feedback))
{{ $feedback }}
@enderror
</span>
</div>
</div>