Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to filter by nested relation scopes #519

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

ahmedsayedabdelsalam
Copy link
Contributor

@ahmedsayedabdelsalam ahmedsayedabdelsalam commented Sep 3, 2020

// users/1?filter[posts.older_than]=2020-09-03
in english: filter users who have posts older than exact time.

the older than scope is placed in the Post Model
I use the Query Builder on the User Model and I wanted to filter them with a scope placed in the related posts.

AllowedFilter::scope('posts.older_than)

@AlexVanderbist
Copy link
Member

Neat, thanks for the PR!

@AlexVanderbist AlexVanderbist merged commit 0010269 into spatie:master Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants