ldc-crm/resources/views/bo/partials/inputs/varchar-password.blade.php
2023-10-06 16:37:30 +02:00

44 lines
2.1 KiB
PHP

{{--
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
$placeholder || The placeholder of the input. || string || OPTIONNAL || __('Un beau mot de passe')
$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
<div class="col-12 input-group d-flex w-100 justify-content-center">
<input id="{{ $id }}"
name="{{ $name }}"
type="password"
value="{{ old($name, $model->{$name} ?? '') }}"
class="form-control @if($errors->has($name)) is-invalid @endif @if(!empty($hasWordCounter ?? false)) need-word-counter-password @endif"
id="{{ $id }}"
aria-describedby="{{ $id }}Help"
placeholder="{{ $placeholder ?? __('Un beau mot de passe') }}"
autocomplete="current-password"
@if(!empty($required))
required
@endif>
@php $dataPassword = ['inputId' => $id]; @endphp
<span class="btn btn-primary password-visibility w-fit d-flex justify-content-center align-items-center p-0 @if(!empty($hasWordCounter ?? false)) need-word-counter-password-btn @endif"
data-json='@json($dataPassword)'>
</span>
</div>
@include('modules.input-error', [
'inputName' => $name,
'helperId' => $id . 'Help',
'helper' => $helper
])