Strengths:
AbsoluteDate) for business logic, decoupling from system clock, which is valuable for:
AbsoluteDateClock for mocking).DateTimeZoneType).{{ date|date }}).AbsoluteDateTranslatable) for i18n-heavy applications.Gaps:
FrameworkBundle, Clock component). Laravel’s Carbon and Illuminate\Support\Facades\Time are dominant, and this bundle may introduce friction.AbsoluteDate.DateValid).Time facade already handles time mocking in tests, potentially reducing the need for AbsoluteDateClock.Clock, Serializer), which Laravel lacks natively. Would need polyfills or wrappers.symfony/clock: Laravel’s Carbon could replace this with minimal effort.symfony/serializer: Laravel’s Illuminate\Support\Serializer or Spatie\ArrayToXml could substitute.ext-intl: Required for timezone handling (Laravel already depends on this).Time facade and Carbon are deeply embedded. Introducing AbsoluteDateClock could create ambiguity in time-aware logic.AbsoluteDateNormalizer) may add latency in high-throughput APIs.travel() (Laravel Breeze) or mocks Clock, reducing the bundle’s unique value.AbsoluteDate only for domain-specific timestamps (e.g., audit logs, events) while keeping Carbon for system-level dates.AbsoluteDate::fromCarbon($carbon)).Clock abstraction initially.AbsoluteDate over Laravel’s native Carbon/Time? What problem does this solve that existing tools don’t?Illuminate\Bus\Dispatchable)? Would events use AbsoluteDate or Carbon?created_at timestamps)?spatie/laravel-activitylog (for timestamps) or nesbot/carbon (for time manipulation) suffice?laravel-time) that offers similar abstractions?Compatibility matrix:
| Component | Laravel Native | Symfony Bundle | Workaround Needed |
|---|---|---|---|
| Doctrine Types | ❌ No | ✅ Yes | Custom Eloquent accessors |
| Twig Filters | ❌ (Blade) | ✅ Yes | Add Twig as dependency |
| Serialization | ✅ (Partial) | ✅ Yes | Polyfill Serializer |
| Time Abstraction | ✅ (Carbon) |
✅ (Clock) |
Hybrid AbsoluteDate + Carbon |
| Translatable Dates | ❌ No | ✅ Yes | Manual i18n integration |
Laravel-specific adaptations required:
register().LaravelClock class extending AbsoluteDateClock to integrate with Carbon.AbsoluteDate accessors/cast types for models (e.g., protected $dates = ['absolute_created_at'];).twig/twig via Composer).@date($variable)).AbsoluteDateType for a new model field).AbsoluteDateClock for time-travel testing (replace travel() where needed).Order timestamps).Carbon-based timestamps with AbsoluteDate in new features.AbsoluteDate patterns (e.g., "never use now(); use AbsoluteDate::now()").Carbon/Time.AbsoluteDate::fromCarbon($carbon)) during transition.symfony/clock and symfony/serializer may conflict with Laravel’s autowiring. Solution: Explicitly bind interfaces to Laravel implementations.ext-intl is already required by Laravel for Carbon.twig/twig if using Twig templates (or implement Blade directives).assoconnect/php-date-bundle).config/app.php (Symfony-style) or create a Laravel service provider.AbsoluteDate for new model fields (avoid touching existing created_at/updated_at).Carbon-based logic in business services (e.g., OrderService::calculateDeadline()).AbsoluteDateClock for time-travel scenarios.AbsoluteDate ensures time immutability across services.AbsoluteDateClock.AbsoluteDate → Carbon → DB.How can I help you explore Laravel packages today?