-
Notifications
You must be signed in to change notification settings - Fork 17
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 Where Nested Support #55
Comments
Hi Is there a way to accomplish the or behaviour with version 1 or 2 from this package? Initial situation: Records of events with various states (active, bookable ef.) Is there a way to solve this with version 1? Thanks for a hint. |
I don't think this is implemented at all yet, but you can do it just by writing regular find requests. User::where('age', '>', 10)->where('name_first', 'michael')->orWhere('age', '>', 10)->where('name_last', 'deck'); You can upgrade Jetstream FileMaker to v2, which should also install Eloquent FileMaker v2. That's probably the easiest solution! With v2 I recommend enabling the |
Hi I tried your example, but I do not get the desired result.
While the first two where-clauses need to be intact and the following two are either or... Is this possible? Thanks also for the hint about version 2 from the filemaker-jetstream package. |
You need to move your orWhere Event::where('d_Standort_n', '=', $eventLocale)
->where('xCalc_WebOnline_ctu', '=', 1)
->orWhere('xCalc_Kursleitung_ctu', $this->search)
->where('d_NameD_t', $this->search); |
Hi Unfortunately this does not encapsulate the query right. Because the first two where conditions are mandatory and the "orWhere" is a supplement. or in eloquent style: Is there a way to solve this with filemaker-eloquent? BR and thank you for your support! |
Ah, I see. This is just a matter of organizing the FileMaker finds correctly. You can think about how you'd manually enter this into multiple FileMaker finds. $data = Veranstaltung::query()
->where('d_Standort_n', 1)->where('xCalc_WebOnline_ctu', 1)->where('d_NameD_t', $search )
->orWhere('d_Standort_n', 1)->where('xCalc_WebOnline_ctu', 1)->where('xCalc_Zielgruppe_ctu', $search )
->get(); would give you two find requests, like
|
Hi You're a HERO! Thanks a lot for your help., |
Ran into this while doing some testing for #78. You probably know this already, but for future reference, the nested query is not getting converted to params when making the request: |
We need to look into adding WhereNested in the query builder. This should work similar to the whereIn and that the resulting query needs to be distributed appropriately based on the current find request.
Some tests and their resulting find requests:
The text was updated successfully, but these errors were encountered: