ldc-volena/resources/views/bo/partials/inputs/tinyint-boolean.blade.php
Jérémy Munsch f3d79cf7a9
Bump with laravel base controller phpstan and phpcs
Still TODO picture sizes for seeders
2024-02-12 15:51:31 +01:00

31 lines
1.3 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
--}}
@php $default = boolval($default ?? false); @endphp
<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') ? $default : ($model->{$name} ?? $default))))>
</div>
@include('modules.input-error', [
'inputName' => $name,
'helperId' => "{$id}Help",
'helper' => $helper
])