Skip to content

Instantly share code, notes, and snippets.

@sawirricardo
Created August 8, 2023 03:40
Show Gist options
  • Save sawirricardo/e07e9d481769c3277b437b23dbe31c1b to your computer and use it in GitHub Desktop.
Save sawirricardo/e07e9d481769c3277b437b23dbe31c1b to your computer and use it in GitHub Desktop.
make livewire send timezone on each request
import './bootstrap';
window.addEventListener('livewire:init', () => {
Livewire.hook('request', ({ options }) => {
options.headers["X-Timezone"] = Intl.DateTimeFormat().resolvedOptions().timeZone;
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment