bukashk0zzz/timestamptype-bundle
DateTime fields with time precision). Useful for audit logs, scheduled tasks, or event timestamps where granularity matters.symfony/form in Laravel 8+) or as a standalone PHP library (stripped of Symfony dependencies).FormBuilder, so if the app already uses Symfony forms, adoption is straightforward. For Laravel, requires either:
spatie/laravel-symfony-support).TimestampType logic in a Laravel form component).@Assert\Type, @Assert\NotBlank). Laravel’s built-in validation would need mapping.symfony/form, symfony/validator).Symfony\Component\* vs. Laravel’s autoloading).laravel-form-components)?Symfony\UX\LiveComponent + custom datetime input.spatie/laravel-temporary-files, livewire/tables (for datetime filtering), or native Carbon/Livewire integration.DateTimeType)?| Component | Symfony | Laravel |
|---|---|---|
| Form System | Native (symfony/form) |
Collective/Livewire/FormRequest |
| Dependency Injection | Native | Laravel’s container (compatible with Symfony DI) |
| Validation | Symfony’s @Assert |
Laravel’s Validator |
| Bundle Support | Native (AppKernel.php) |
Limited (requires symfony/bridge) |
bundles.php (Symfony 5.3+) or AppKernel.php, configure form types, and use TimestampType in forms.spatie/laravel-symfony-support) to register the bundle.TimestampType class) and adapt it to Laravel’s Form or Livewire components.livewire/datetime).text, datetime-local, or custom components).TimestampType would reduce boilerplate.@Assert\Type("datetime")).DateTime type is used).TimestampType using Laravel’s Form or Livewire.DateTimeType if issues arise.composer.json constraints).DateTime/DateTimeImmutable fields. No schema changes, but ensure the app’s ORM (Doctrine, Eloquent) handles timestamps correctly.datetime-local input. May need CSS/JS tweaks for styling or client-side validation.composer.json and run composer update.widget => 'single_text', format => 'Y-m-d H:i:s').DateTimeType with TimestampType in forms:
// Symfony Example
$builder->add('eventTime', TimestampType::class, [
'widget' => 'single_text',
'attr' => ['class' => 'timestamp-input'],
]);
symfony/form).TimestampType class for easier replacement.DateTime fields are indexed if used in queries.| Failure Scenario | Impact | **Mit
How can I help you explore Laravel packages today?