ldc-gen-game-web/resources/views/partials/inputs/timestamp-datetime.blade.php
2023-11-27 12:04:19 +01:00

28 lines
1.2 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
$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
<input id="{{ $id }}"
name="{{ $name }}"
class="form-control @if($errors->has($name)) is-invalid @endif"
type="datetime-local"
data-form-type="date"
aria-describedby="{{ "{$id}Help" }}"
value="{{ old($name, ((isset($model) and $model->{$name}) ? ($model->{$name}->format('Y-m-d\TH:i') ?? '') : '')) }}">
@include('modules.input-error', [
'inputName' => $name,
'helperId' => "{$id}Help",
'helper' => $helper
])