@props([ 'label', 'name', 'value' => null, 'placeholder' => __('Select a date'), 'required' => false, 'options' => [], 'script' => true, ]) @php if (! array_key_exists('dateFormat', $options)) { $options['dateFormat'] = 'd.m.Y'; } $options['locale'] = app()->getLocale(); $class = 'form-control flatpickr-input ' . $attributes['class']; @endphp {!! Form::text($name, optional($value)->format($options['dateFormat']), [ 'id' => $name, 'class' => $class, 'placeholder' => $placeholder, 'attributes' => $attributes->except('class'), ]) !!} @if ($script) @push('scripts') @endpush @endif