query changed

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

View File

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