From 79a94de4dd55e151987a1a7c69a161d3666fa889 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Wed, 12 Feb 2025 10:13:57 -0600 Subject: [PATCH] remove `APP_TIMEZONE` environment variable (#6536) force the timezone to be defined in the config file, rather than deferring to an environment variable. IMO having the timezone dependent on an environment variable adds an unnecessary amount of risk for your average user who may be unaware of the effects from changing this value. some scenarios where this could cause issues: - devs set this value to their local timezone on their local dev machines, and they are writing `Carbon:create()` commands or similar that now are working only under the assumption of that timezone value - you have multiple production servers setup across the country and each has their own timezone value according to their location, but they all talk to a central database. now the database is loaded with mixed timezone variables having an explicit value defined once for the application removes these risks. reverts part of #6188 --- .env.example | 1 - config/app.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 6fb3de652..93561a48d 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,6 @@ APP_NAME=Laravel APP_ENV=local APP_KEY= APP_DEBUG=true -APP_TIMEZONE=UTC APP_URL=http://localhost APP_LOCALE=en diff --git a/config/app.php b/config/app.php index f46726731..324b513a2 100644 --- a/config/app.php +++ b/config/app.php @@ -65,7 +65,7 @@ return [ | */ - 'timezone' => env('APP_TIMEZONE', 'UTC'), + 'timezone' => 'UTC', /* |--------------------------------------------------------------------------