-
-
Notifications
You must be signed in to change notification settings - Fork 438
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 @whereHasConditions
directive to filter relation existence
#1140
Add @whereHasConditions
directive to filter relation existence
#1140
Conversation
@chescos looking forward to seeing the results, nice! The tests look good. Let's do the renaming now, i think that will be the least effort overall. It's bettter to make such breaking changes early, before this becomes so great that everybody will use it. We should be able to include it as a stable feature soon. |
tests/Integration/WhereHasConditions/WhereHasConditionsDirectiveTest.php
Outdated
Show resolved
Hide resolved
@spawnia The A code review would be awesome. After that, I'd add the documentation and add it to the changelog. |
All related code should be in a namespace |
… same namespace as whereHasConditions directive
@spawnia great call, thanks! That made things a lot cleaner already. Anything else that could be improved? |
tests/Integration/WhereConditions/WhereHasConditionsDirectiveTest.php
Outdated
Show resolved
Hide resolved
@spawnia could you give it another review? |
This is starting to come together quite nicely. The refactorings and unification has brought the added line count down from ~800 to ~350, which i am much more comfortable with from a maintenance standpoint. |
Yes, looking nice so far. Anything else that needs improvement? |
This is good to go, awesome work. We might consider marking this feature as stable in |
@whereHasConditions
directive@whereHasConditions
directive to filter relation existence
Resolves #1112
Changes
This PR adds a new directive called
@whereHasConditions
. This directive is very similar to the@whereConstraints
directive, except that the query conditions are applied to an Eloquent relationship.The
@whereConstraints
directive has also been renamed to@whereConditions
after a discussion in #1112.Here's how the
@whereHasConditions
directive can be used in the schema:And here's an example query:
Breaking changes
The
@whereConstraints
directive has been renamed to@whereConditions
.