From 7fc01fa1ecf5010d41c815975c1fdbc6741b0653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Wed, 6 Apr 2016 20:30:55 +0200 Subject: [PATCH] FIX: fix typo in COALESCE and escaping --- app/Models/Content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Content.php b/app/Models/Content.php index 176aa9d3..9c60d8c9 100644 --- a/app/Models/Content.php +++ b/app/Models/Content.php @@ -177,7 +177,7 @@ class Content extends Model // join user email and user name to results when needed if ($joinAuthor) { $query = $query->join('users', 'users.id', '=', 'contents.user_id') - ->addSelect('COALESCE(users.name, users.email) AS author_name') + ->addSelect(DB::raw('COALESCE(users.name, users.email) AS author_name')) ->addSelect('users.email AS author_email'); }