Files
InvoiceShelf/config/app.php
Darko Gjorgjijoski 3b2aa1ca2e fix(config): make the application timezone configurable (#703)
Fixes InvoiceShelf/docker#64 — recurring invoices and scheduled tasks
running on the wrong timezone.

Two bugs compounded so that no supported value had any effect:

config/app.php had no timezone key at all, so Laravel's own fallback won
— and that fallback is a literal 'UTC' string, not an env() lookup
(vendor/laravel/framework/config/app.php). APP_TIMEZONE has therefore
been inert since the config was slimmed, despite being shipped in
.env.example.

inject.sh wrote a bare TIMEZONE key into .env, which nothing reads, so
setting the documented container variable also did nothing. It now
writes APP_TIMEZONE, and accepts either name so existing compose files
keep working without edits.

Verified against a built image: TIMEZONE=Europe/Berlin now yields
APP_TIMEZONE=Europe/Berlin in .env and config('app.timezone') ==
Europe/Berlin, where before both spellings left it on UTC.
2026-07-29 12:23:20 +02:00

37 lines
1.1 KiB
PHP

<?php
use Illuminate\Support\Facades\Facade;
return [
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| The default timezone for date and date-time functions. Laravel's own
| fallback is the literal string 'UTC' rather than an env() lookup, so
| without this key APP_TIMEZONE has no effect at all and scheduled tasks
| and recurring invoices always run on UTC.
|
*/
'timezone' => env('APP_TIMEZONE', 'UTC'),
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. You may add any additional class aliases which should
| be loaded to the array. For speed, all aliases are lazy loaded.
|
*/
'aliases' => Facade::defaultAliases()->merge([
'Menu' => Lavary\Menu\Facade::class,
])->toArray(),
];