Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
636 stars 200 forks source link

Problem with nested WhereHas #271

Closed dimitriSpb closed 4 years ago

dimitriSpb commented 6 years ago

Hi,

I can't use nested whereHas with queryBuilder because it use only my first whereHas.

This is example : $collection = Lead::whereHas('guest', function($q){ $q->whereHas('candidature', function($c){ $c->whereHas('campaign',function($camp){ $camp->where('id_mdb',4); }); }); })->get();

Query result : MATCH (lead:Lead), (lead)<-[rel_has_generated_guest:has_generated]-(guest:Guest) WHERE guest.candidature.campaign.id_mdb = 4 and lead.deleted_at is null RETURN lead As you can see only first whereHas and where clause is bad : guest.candidature.campaign.id_mdb = 4

I do something bad ? You have a solution ? Or it's bug ?

Lumen (5.4.7) (Laravel Components 5.4.) "vinelab/neoeloquent": "1.4.",

fabriciohens commented 6 years ago

Hi, I have the same problem. Have you found a solution? Thanks!

rom1vtle commented 6 years ago

Yes me too, i have the same problem with nested wherehas. Just the first one is used. Any solutions ? Thank you

neilodiaz commented 5 years ago

Hi,

This is related to this issue. Update your composer.json to latest Lumen version:

"laravel/lumen-framework": "5.7.*"

This works for me.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.