ldc-gen-game-web/resources/views/partials/inputs/varchar.blade.php
2023-12-06 16:39:21 +01:00

42 lines
1.8 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 || OPTIONNAL || null
$required || Is the field required ? || boolean || OPTIONNAL || false
$value || The default value of the input. || string || OPTIONNAL || ''
$placeholder || The placeholder of the input. || string || OPTIONNAL || __('A beautiful title')
$hasWordCounter || Is the WordCounter needed ? || boolean || OPTIONNAL || false
$model || The model we're creating/editing || Model class || OPTIONNAL || null
--}}
@if(!empty($label))
<label for="{{ $id }}" class="col-form-label">
<b>{{ $label }} {{ $required ?? false ? '*' : '' }}</b>
</label>
@endif
@if(!empty($hasWordCounter ?? false))
<div class="word-counter" data-json='@json(['id'=> $id])'></div>
@endif
<input name="{{ $name }}"
type="text"
value="{{ old($name, $model->{$name} ?? $value ?? '') }}"
class="form-control @if($errors->has($name)) is-invalid @endif"
@class([
'form-control',
'is-invalid' => $errors->has($name)
])
id="{{ $id }}"
aria-describedby="{{ $id }}Help"
placeholder="{{ $placeholder ?? __('A beautiful title') }}"
@disabled(!empty($disabled))
@readonly(!empty($readonly))
@required(!empty($required))>
@include('modules.input-error', [
'inputName' => $name,
'helperId' => $id.'Help',
'helper' => $helper
])