From 7e91d7b9b45d25beb6ac3c12087cf6caef8ba60d Mon Sep 17 00:00:00 2001 From: Alan Wynn Date: Mon, 18 Jul 2022 18:12:45 +0100 Subject: [PATCH] Update SQL Version Call This is causing an issue for Postgres, when you select `version()`, its returning the result as `version`. Setting the `as` on the statement fixes this issue. --- src/Http/Controllers/VersionController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/Controllers/VersionController.php b/src/Http/Controllers/VersionController.php index 21fb830..794dedb 100644 --- a/src/Http/Controllers/VersionController.php +++ b/src/Http/Controllers/VersionController.php @@ -31,8 +31,8 @@ private function getDatabase() return 'Unkown'; } - $results = DB::select(DB::raw("select version()")); + $results = DB::select(DB::raw("select version() as version")); - return $results[0]->{'version()'}; + return $results[0]->version; } }