From 9921c5002a1883798fb31fc27d58c5b011a6bd37 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 13 Oct 2019 20:34:13 +0200 Subject: [PATCH] DatabaseServiceProvider: Use timezone from config (was not set before) --- src/Database/DatabaseServiceProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Database/DatabaseServiceProvider.php b/src/Database/DatabaseServiceProvider.php index d0068b54..b5225015 100644 --- a/src/Database/DatabaseServiceProvider.php +++ b/src/Database/DatabaseServiceProvider.php @@ -15,6 +15,7 @@ class DatabaseServiceProvider extends ServiceProvider { $config = $this->app->get('config'); $capsule = $this->app->make(CapsuleManager::class); + $now = Carbon::now($config->get('timezone')); $dbConfig = $config->get('database'); $capsule->addConnection(array_merge([ @@ -25,7 +26,7 @@ class DatabaseServiceProvider extends ServiceProvider 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', - 'timezone' => Carbon::now()->format('P'), + 'timezone' => $now->format('P'), 'prefix' => '', ], $dbConfig));