fixed notification query

This commit is contained in:
Cüneyt Şentürk 2021-06-25 12:24:28 +03:00
parent aad691c5ae
commit 1b7f7ac34e
2 changed files with 8 additions and 4 deletions

View File

@ -57,8 +57,10 @@ class Exports extends Component
protected function getNotifications($limit = false)
{
$query = user()->notifications()->unread()
->where('type', 'App\Notifications\Common\ExportCompleted')
->where('type', 'App\Notifications\Common\ExportFailed');
->where(function ($query) {
$query->where('type', 'App\Notifications\Common\ExportCompleted')
->orWhere('type', 'App\Notifications\Common\ExportFailed');
});
if ($limit) {
$notifications = $query->paginate($limit);

View File

@ -57,8 +57,10 @@ class Imports extends Component
protected function getNotifications($limit = false)
{
$query = user()->notifications()->unread()
->where('type', 'App\Notifications\Common\ImportCompleted')
->where('type', 'App\Notifications\Common\ImportFailed');
->where(function ($query) {
$query->where('type', 'App\Notifications\Common\ImportCompleted')
->orWhere('type', 'App\Notifications\Common\ImportFailed');
});
if ($limit) {
$notifications = $query->paginate($limit);