Skip to content

Check if all ancestors fulfill condition #249

Answered by staudenmeir
jacobmllr95 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jacobmllr95,
You could check the "opposite" - that a page doesn't have any inactive ancestors:

Page::whereNotHas('ancestors', fn($query) => $query->where('active', false))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jacobmllr95
Comment options

Answer selected by jacobmllr95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants