ldc-agis/resources/views/bo/partials/inputs/tinyint-boolean.blade.php

31 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2023-12-21 13:56:34 +01:00
{{-- blade-formatter-disable --}}
2023-12-19 15:09:12 +00:00
{{--
VARIABLE || COMMENT || TYPE || REQUIRED || DEFAULT
$id || The id of the input tag. || string || REQUIRED ||
$name || The name of the input tag. || string || REQUIRED ||
$helper || The helper of the input. || string || REQUIRED ||
$label || The text displayed as a label. || string || REQUIRED ||
$model || The model we're creating/editing || Model class || OPTIONNAL || null
--}}
<div class="form-check form-switch ms-2">
2023-12-21 13:56:34 +01:00
<label class="col-form-label p-0" for="{{ $id }}"><b>{{ $label }}</b></label>
2023-12-19 15:09:12 +00:00
<input
id="{{ $id }}"
aria-describedby="{{ $id }}Help"
name="{{ $name }}"
type="checkbox"
class="ml-2 form-check-input"
value="1"
2023-12-21 13:56:34 +01:00
@disabled(!empty($disabled))
@readonly(!empty($readonly))
@required(!empty($required))
@checked(old($name, (old('_token') ? false : ($model->{$name} ?? false))))>
2023-12-19 15:09:12 +00:00
</div>
@include('modules.input-error', [
'inputName' => $name,
2023-12-21 13:56:34 +01:00
'helperId' => "{$id}Help",
2023-12-19 15:09:12 +00:00
'helper' => $helper
])