From 3fb875e3851fcebe80fa1d7f6bb0d74951a43f11 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 9 May 2020 14:45:57 +0200 Subject: [PATCH] Fix notification query with DB prefix This was fixed in https://github.com/laravel/framework/pull/28400. See commit 928b36013576bc5d45bbd587c46e75cc7f6e7012. --- .../core/src/Notification/NotificationRepository.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/framework/core/src/Notification/NotificationRepository.php b/framework/core/src/Notification/NotificationRepository.php index d1baf5c25..96030f98a 100644 --- a/framework/core/src/Notification/NotificationRepository.php +++ b/framework/core/src/Notification/NotificationRepository.php @@ -11,7 +11,6 @@ namespace Flarum\Notification; use Carbon\Carbon; use Flarum\User\User; -use Illuminate\Database\Query\Expression; class NotificationRepository { @@ -36,11 +35,8 @@ class NotificationRepository ->skip($offset) ->take($limit); - return Notification::select('notifications.*') - ->selectRaw('p.unread_count') - // Expression is necessary until Laravel 5.8. - // See https://github.com/laravel/framework/pull/28400 - ->joinSub($primaries, 'p', 'notifications.id', '=', new Expression('p.id')) + return Notification::select('notifications.*', 'p.unread_count') + ->joinSub($primaries, 'p', 'notifications.id', '=', 'p.id') ->latest() ->get(); }