31 lines
1.4 KiB
PHP
31 lines
1.4 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
|
|
$model || The model we're creating/editing || Model class || OPTIONNAL || null
|
|
$type || The input data type || string || OPTIONNAL || datetime-local
|
|
$format || The inpute date format || string || OPTIONNAL || Y-m-d\TH:i
|
|
--}}
|
|
|
|
@if (!empty($label))
|
|
<label class="col-form-label" for="{{ $id }}">
|
|
<b>{{ $label }} {{ $required ?? false ? '*' : '' }}</b>
|
|
</label>
|
|
@endif
|
|
<input id="{{ $id }}"
|
|
name="{{ $name }}"
|
|
class="form-control @if ($errors->has($name)) is-invalid @endif"
|
|
type="{{ $type ?? 'datetime-local' }}"
|
|
data-form-type="date"
|
|
value="{{ old($name, (isset($model) and $model->{$name}) ? $model->{$name}->format($format ?? 'Y-m-d\TH:i') ?? '' : '') }}"
|
|
aria-describedby="{{ "{$id}Help" }}">
|
|
@include('modules.input-error', [
|
|
'inputName' => $name,
|
|
'helperId' => "{$id}Help",
|
|
'helper' => $helper,
|
|
])
|