From 80a18f738048da11b0f9eaf7a2a7110d0170914e Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Fri, 27 Jan 2023 02:25:17 +1100 Subject: [PATCH] Update Log.php SQL previously incompatible with some versions of MariaDB --- src/Models/Log.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Models/Log.php b/src/Models/Log.php index 8d08c05..0721255 100644 --- a/src/Models/Log.php +++ b/src/Models/Log.php @@ -37,12 +37,12 @@ public function getCreatedAtAttribute(?string $date): ?string public static function counts(): mixed { return static::query() - ->selectRaw("count(*) as all") - ->selectRaw("count(case when method = 'GET' then 1 end) as get") - ->selectRaw("count(case when method = 'POST' then 1 end) as post") - ->selectRaw("count(case when method = 'PUT' then 1 end) as put") - ->selectRaw("count(case when method = 'PATCH' then 1 end) as patch") - ->selectRaw("count(case when method = 'DELETE' then 1 end) as delete") + ->selectRaw("count(*) as `all`") + ->selectRaw("count(case when method = 'GET' then 1 end) as `get`") + ->selectRaw("count(case when method = 'POST' then 1 end) as `post`") + ->selectRaw("count(case when method = 'PUT' then 1 end) as `put`") + ->selectRaw("count(case when method = 'PATCH' then 1 end) as `patch`") + ->selectRaw("count(case when method = 'DELETE' then 1 end) as `delete`") ->first(); } }