ldc-gen-game-web/resources/views/partials/inputs/tinyint-boolean.blade.php
2023-12-12 12:25:45 +01:00

30 lines
1.2 KiB
PHP

{{-- blade-formatter-disable --}}
{{--
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">
<label class="col-form-label p-0" for="{{ $id }}"><b>{{ $label }}</b></label>
<input
id="{{ $id }}"
aria-describedby="{{ $id }}Help"
name="{{ $name }}"
type="checkbox"
class="ml-2 form-check-input"
value="1"
@disabled(!empty($disabled))
@readonly(!empty($readonly))
@required(!empty($required))
@checked(old($name, (old('_token') ? false : ($model->{$name} ?? false))))>
</div>
@include('modules.input-error', [
'inputName' => $name,
'helperId' => "{$id}Help",
'helper' => $helper
])