Scope in query #6168
Unanswered
david-lobo
asked this question in
Q&A
Scope in query
#6168
Replies: 1 comment
-
#5927 is aiming to make it nicer to do that, but in the mean time you could do this: $query = Entry::query()
->where('collection', 'events');
->limit(5);
(new EventEntries)->apply($query, []);
$entries = $query->get(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a query scope being used inside a collection tag in Antlers, but i want to make a custom tag instead with the query in the PHP code. Is there a way to use a scope inside a PHP collection/entry query?
This is the Scope:
App\Scopes\EventEntries
And this is the query i am trying to use:
Beta Was this translation helpful? Give feedback.
All reactions