digitalframe/beta-datetimepicker-bundle
FormRequest, FormBuilder facades).use statements for Laravel’s Form helpers).FormRequest trait).assets:install step must be replaced with manual asset registration.Carbon handles datetime parsing, but the bundle’s Symfony-specific validation/normalization (e.g., DateTimeType) must be translated to Laravel’s Request validation or Form Request rules.config.yml approach conflicts with Laravel’s config/datetimepicker.php; requires custom facade or service provider.Form component or using a bridge like symfony/form via Composer).davidstutz/bootstrap-4, shaher/yajra-datetimepicker).Carbon and Request validation can replace Symfony’s datetime handling, but the bundle’s FormType logic (e.g., df_datetime field) must be rewritten.created_at, event_date).<!-- Blade -->
<input type="text" class="form-control datetimepicker" name="event_date">
@push('scripts')
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/eonasdan-bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<script>
$('.datetimepicker').datetimepicker();
</script>
@endpush
df_datetime behavior:
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\HtmlString;
Blade::directive('datetimepicker', function ($expression) {
return new HtmlString(
'<input type="text" class="form-control datetimepicker" name="' . $expression . '">'
);
});
public function rules()
{
return [
'event_date' => 'required|date_format:Y-m-d H:i',
];
}
/src/
Providers/DatetimepickerServiceProvider.php
Components/Datetimepicker.php (extends Laravel Form Component)
Symfony/Form, Symfony/OptionsResolver: Must be replaced with Laravel equivalents (e.g., Illuminate/Validation, custom form logic).Twig: Not used in Laravel; Blade templates would need manual JS injection.AppKernel: Replace with Laravel’s config/app.php service providers.assets:install: Replace with npm install + mix.copy.## Laravel Datetimepicker Usage
1. Install via npm: `npm install @eonasdan/bootstrap-datetimepicker`
2. Add to Blade:
@datetimepicker('event_date', ['format' => 'DD/MM/YYYY'])
3. Validate in Form Request:
public function rules() { return ['event_date' => 'required|date']; }
| Scenario | Impact | Mitigation |
|---|---|---|
| Bundle abandonment | Broken integration | Fork or switch to native solution |
| Eonasdan picker deprec. | UI breaks | Migrate to Flatpickr/Tempus Dominus |
| Laravel upgrade | Custom Form Macro breaks | Test in staging; use trait isolation |
| Asset pipeline issues | JS/CSS not loaded | Fallback to CDN links |
How can I help you explore Laravel packages today?