- Written by Mohammed Hicham
- Category: Laravel
- Hits: 1805
Laravel - How to Auto Set a Timezone for Users
When it comes to Timezone, most Laravel developers face some struggle. Here is a 4 steps workflow that is going to save you precious time. For that, we are going to use a package called Laravel-time-zone created by James Mills. The package listens for the \Illuminate\Auth\Events\Login event and then sets a timezone for the logged-in user based on his IP address (stored in the database).