You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe...
In our project we have a use case of needed a orHasNot.
Our goal is to retrieve all work orders which are not planned (planned_start is null) OR don't have a users assigned to it so that we can show in a planning tool which work orders require an action (planning and/or assigning a user.
Describe the solution you'd like
WorkOrder.query().with(...)// Left out for demo purposes.where((workOrder,query)=>{query.where('planned_start',null).orHasNot('users')}).orderBy(...)// Left out for demo purposes.get()
Describe alternatives you've considered
The alternative that we are forced to use now is (my opinion) ugly code and can be seen below:
WorkOrder.query().with(...)// Left out for demo purposes.where((workOrder,query)=>{if(!workOrder.planned_start){query.where('planned_start',null)}else{query.hasNot('users')}}).orderBy(...)// Left out for demo purposes.get()
Additional context
I'm looking for something like ->orHas(...) and/or ->orDoesntHave(...) in Laravel. Though considering Vuex's naming with relations I expect them to be called .orHas(...) and .orHasNot('...').
It would also be highly appreciated if these function can accept a callback as 2nd argument just like has does to further determine which relationships should match.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe...
In our project we have a use case of needed a
orHasNot
.Our goal is to retrieve all work orders which are not planned (
planned_start
isnull
) OR don't have a users assigned to it so that we can show in a planning tool which work orders require an action (planning and/or assigning a user.Describe the solution you'd like
Describe alternatives you've considered
The alternative that we are forced to use now is (my opinion) ugly code and can be seen below:
Additional context
I'm looking for something like
->orHas(...)
and/or->orDoesntHave(...)
in Laravel. Though considering Vuex's naming with relations I expect them to be called.orHas(...)
and.orHasNot('...')
.It would also be highly appreciated if these function can accept a callback as 2nd argument just like has does to further determine which relationships should match.
The text was updated successfully, but these errors were encountered: