Created
August 8, 2023 03:40
-
-
Save sawirricardo/e07e9d481769c3277b437b23dbe31c1b to your computer and use it in GitHub Desktop.
make livewire send timezone on each request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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