17 lines
No EOL
847 B
PHP
17 lines
No EOL
847 B
PHP
@if(!empty($label))
|
|
<label for="{{ $id }}" class="col-form-label">
|
|
<b>{{ $label }} {{ $required ? '*' : '' }}</b>
|
|
</label>
|
|
@endif
|
|
@if(!empty($hasWordCounter ?? false))
|
|
<div class="word-counter" data-json='@json(['id'=> $id])'></div>
|
|
@endif
|
|
@php
|
|
$defaultValue = $name === 'key' ? Str::slug(Str::random(6)) : '';
|
|
@endphp
|
|
<input name="{{ $name }}" type="text" value="{{ old($name, $model->{$name} ?? $defaultValue) }}" class="form-control @if(!empty($hasWordCounter ?? false)) need-word-counter @endif" id="{{ $id }}" aria-describedby="{{ $id }}Help" placeholder="{{ $placeholder ?? __('Un nom beau et explicite') }}" @if(!empty($required))required @endif @if(!empty($disabled))disabled @endif @if(!empty($readonly))readonly @endif>
|
|
@include('modules.input-error', [
|
|
'inputName' => $name,
|
|
'helperId' => '{{ $id }}Help',
|
|
'helper' => $helper
|
|
]) |