fanatic/resources/views/components/form/checkbox.blade.php
2022-04-26 12:34:38 -07:00

20 lines
No EOL
628 B
PHP

{{-- expected attributes: name --}}
@props([
'divClass' => '',
'value' => '1',
'inputClass' => '',
'current' => null,
'labelClass' => '',
'label'
])
<div class="form__checkbox {{ $divClass }}">
<input type="checkbox" id="{{ $attributes['id'] ?? $attributes['name'] }}" {{ $attributes }}
value="{{ $value }}" class="form__input--checkbox {{ $inputClass }}"
@checked(old($attributes['name'], $current))>
<label for="{{ $attributes['id'] ?? $attributes['name'] }}"
class="form__label--checkbox {{ $labelClass }}">
{{ $label }}
</label>
</div>