{"id":50117549,"url":"https://github.com/webteractive/filament-browser-timezone","last_synced_at":"2026-05-23T16:01:00.577Z","repository":{"id":309136655,"uuid":"1035263819","full_name":"webteractive/filament-browser-timezone","owner":"webteractive","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-30T23:15:41.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T15:02:22.840Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webteractive.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"vendor_name"}},"created_at":"2025-08-10T02:34:17.000Z","updated_at":"2026-01-30T23:14:25.000Z","dependencies_parsed_at":"2025-08-10T05:16:54.373Z","dependency_job_id":"374eb4a8-928f-4eb8-a83b-9866114dbe92","html_url":"https://github.com/webteractive/filament-browser-timezone","commit_stats":null,"previous_names":["webteractive/filament-browser-timezone"],"tags_count":11,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/webteractive/filament-browser-timezone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webteractive%2Ffilament-browser-timezone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webteractive%2Ffilament-browser-timezone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webteractive%2Ffilament-browser-timezone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webteractive%2Ffilament-browser-timezone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webteractive","download_url":"https://codeload.github.com/webteractive/filament-browser-timezone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webteractive%2Ffilament-browser-timezone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33402171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-23T16:00:53.944Z","updated_at":"2026-05-23T16:01:00.557Z","avatar_url":"https://github.com/webteractive.png","language":"PHP","funding_links":["https://github.com/sponsors/vendor_name"],"categories":[],"sub_categories":[],"readme":"# Filament Browser Timezone\n\nA Filament package that automatically detects the user's browser timezone and makes it available to Filament resources, forms, and widgets via session storage.\n\n## Features\n\n- 🕐 **Automatic Detection**: Detects browser timezone on page load\n- 🔒 **Session Storage**: Stores timezone in Laravel session for backend access\n- 🎯 **Filament Integration**: Seamlessly integrates with Filament v3, v4, and v5 via render hooks\n- 🚀 **Zero Configuration**: Works out of the box with default settings\n- 🛡️ **Error Handling**: Graceful fallbacks for unsupported browsers\n- ⚡ **Performance Optimized**: Minimal impact on page load performance\n- 🤖 **AI-Friendly**: Includes Laravel AI custom guidelines for better AI-assisted development\n\n## Installation\n\n```bash\ncomposer require webteractive/filament-browser-timezone\n```\n\nThe package will be automatically discovered by Laravel.\n\n## Usage\n\n### Automatic Integration\n\nThe package automatically integrates with Filament and starts detecting timezone on every page load. No additional configuration required.\n\n### Accessing Browser Timezone\n\n#### In Filament Resources, Forms, and Widgets\n\n```php\nuse Webteractive\\FilamentBrowserTimezone\\BrowserTimezone;\n\n// Get the detected timezone\n$timezone = BrowserTimezone::get();\n\n// Check if timezone is available\nif (BrowserTimezone::has()) {\n    $timezone = BrowserTimezone::get();\n}\n\n// Get with fallback\n$timezone = BrowserTimezone::get('UTC');\n```\n\n#### In Filament Tables\n\n```php\nuse Webteractive\\FilamentBrowserTimezone\\BrowserTimezone;\n\nclass UserResource extends Resource\n{\n    public function table(Table $table): Table\n    {\n        return $table\n            -\u003ecolumns([\n                TextColumn::make('created_at')\n                    -\u003edateTime()\n                    -\u003etimezone(BrowserTimezone::get())\n                    -\u003elabel('Created At'),\n            ]);\n    }\n}\n```\n\n#### In Filament Forms\n\n```php\nuse Webteractive\\FilamentBrowserTimezone\\BrowserTimezone;\n\nclass UserForm extends Form\n{\n    public function form(Form $form): Form\n    {\n        return $form\n            -\u003eschema([\n                DateTimePicker::make('meeting_time')\n                    -\u003etimezone(BrowserTimezone::get())\n                    -\u003elabel('Meeting Time'),\n            ]);\n    }\n}\n```\n\n#### In Filament Widgets\n\n```php\nuse Webteractive\\FilamentBrowserTimezone\\BrowserTimezone;\n\nclass StatsWidget extends Widget\n{\n    public function getColumns(): int\n    {\n        return 2;\n    }\n\n    protected function getTableQuery(): Builder\n    {\n        return User::query()\n            -\u003ewhere('created_at', '\u003e=', now()-\u003esetTimezone(BrowserTimezone::get()));\n    }\n}\n```\n\n## Configuration\n\nPublish the configuration file:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-browser-timezone-config\"\n```\n\n### Configuration Options\n\n```php\n// config/filament-browser-timezone.php\n\nreturn [\n    // Session key for storing timezone\n    'session_key' =\u003e env('BROWSER_TIMEZONE_SESSION_KEY', 'browser_timezone'),\n\n    // Fallback timezone if detection fails\n    'fallback_timezone' =\u003e env('BROWSER_TIMEZONE_FALLBACK', 'UTC'),\n    \n    // Debug mode\n    'debug' =\u003e env('BROWSER_TIMEZONE_DEBUG', false),\n];\n```\n\n### Environment Variables\n\n```env\nBROWSER_TIMEZONE_SESSION_KEY=browser_timezone\nBROWSER_TIMEZONE_FALLBACK=UTC\nBROWSER_TIMEZONE_DEBUG=false\n```\n\n## How It Works\n\n1. **Automatic Integration**: The package automatically integrates with Filament panels using render hooks\n2. **Page Load**: When a Filament page loads, the package automatically includes a hidden Livewire component\n3. **JavaScript Detection**: The component uses JavaScript to detect the browser's timezone using `Intl.DateTimeFormat().resolvedOptions().timeZone`\n4. **Session Storage**: The detected timezone is sent to the server via Livewire and stored in the Laravel session\n5. **Filament Integration**: Your Filament resources, forms, and widgets can now access the timezone using the `BrowserTimezone` helper class\n\n## Filament Features\n\n- **Automatic Detection**: Works out of the box with all Filament panels\n- **Render Hook Integration**: Uses Filament's render hook system for seamless integration\n- **Livewire Component**: Built with Livewire for optimal performance\n- **Session Management**: Integrates with Laravel's session system\n\n## Browser Compatibility\n\nThe package uses the modern `Intl.DateTimeFormat` API which is supported by:\n- Chrome 24+\n- Firefox 29+\n- Safari 10+\n- Edge 12+\n\nFor unsupported browsers, the package will use the configured fallback timezone.\n\n## Version Compatibility\n\n| Package Version | Filament Version | Livewire Version | Laravel Version | PHP Version |\n|----------------|------------------|------------------|-----------------|-------------|\n| 1.x            | ^3.0\\|\\|^4.0\\|\\|^5.0 | ^3.0\\|\\|^4.0     | ^10.0\\|\\|^11.28\\|\\|^12.0\\|\\|^13.0 | ^8.2       |\n\n**Note**: Filament v3 and v4 use Livewire v3, while Filament v5 uses Livewire v4. This package supports both Livewire versions seamlessly.\n\n## Laravel AI Guidelines\n\nThis package includes custom AI guidelines for Laravel 12.x AI features. When using AI assistants with Laravel 12.x projects, the assistant will have access to comprehensive documentation about this package's usage patterns, best practices, and troubleshooting tips.\n\nThe AI guidelines are located in `ai/custom-guidelines.md` and provide:\n- Complete API reference\n- Common usage patterns for Tables, Forms, and Widgets\n- Troubleshooting guides\n- Best practices and examples\n- Common mistakes to avoid\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests\n5. Submit a pull request\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebteractive%2Ffilament-browser-timezone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebteractive%2Ffilament-browser-timezone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebteractive%2Ffilament-browser-timezone/lists"}