webteractive/filament-browser-timezone
BrowserTimezone facade/helper) for accessing browser timezones in Filament resources, forms, and widgets, reducing boilerplate and improving maintainability.composer require and works out-of-the-box with Filament panels.Intl.DateTimeFormat), which may require polyfills for legacy browsers (though the package provides graceful fallbacks).Use Case Alignment:
Performance Impact:
Fallback Strategy:
Testing Coverage:
Future-Proofing:
Alternatives:
config('app.timezone')) or a simpler JavaScript-based solution without Livewire?panels::body.start) for automatic integration, ensuring it works across major versions without modification.composer.json. Laravel 13 requires PHP 8.3, but the package maintains PHP 8.2 support for older Laravel versions.Assessment:
Installation:
composer require webteractive/filament-browser-timezone
php artisan vendor:publish --tag="filament-browser-timezone-config"
Adoption:
BrowserTimezone::get():
// Before
TextColumn::make('created_at')->timezone('UTC');
// After
TextColumn::make('created_at')->timezone(BrowserTimezone::get('UTC'));
BrowserTimezone in unit tests).Validation:
Phase 1: Pilot Integration
Phase 2: Broad Adoption
Phase 3: Optimization
'debug' => true) logs timezone detection and session storage events, aiding troubleshooting.filament:timezone:clear artisan command provides a tool to reset stored timezones for testing or user-specific issues.BrowserTimezone behavior in critical paths (e.g., event scheduling, reporting).BrowserTimezone in Filament resources/forms/widgets. Include examples in the project’s internal documentation.BrowserTimezone::isValid() for validation).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Browser timezone detection fails | Falls back to configured timezone (default: UTC). | Validate fallback timezone; monitor debug logs for detection failures. |
How can I help you explore Laravel packages today?