query changed

This commit is contained in:
HolgerHatGarKeineNode
2023-02-11 15:58:51 +01:00
parent 3cad478856
commit 0b3528a4f0

View File

@@ -38,13 +38,13 @@ class ArticleOverview extends Component
if (auth()->user() && auth() if (auth()->user() && auth()
->user() ->user()
->hasRole('news-editor')) { ->hasRole('news-editor')) {
} else { return;
}
$query $query
->whereHas('createdBy.roles', ->whereHas('createdBy.roles',
fn($query) => $query->where('roles.name', 'news-editor')) fn($query) => $query->where('roles.name', 'news-editor'))
->where('approved', true); ->where('approved', true);
} }
}
) )
->orderByDesc('created_at') ->orderByDesc('created_at')
->get(), ->get(),