selahattinunlu / laravel-api-query-builder

Laravel & Lumen Api Query Builder Package
331 stars 66 forks source link

Support for orWhere #18

Closed alekslyse closed 7 years ago

alekslyse commented 7 years ago

Are you planning to add support for an orWhere parameter with the same operators as the where statement. Its not uncommon to need a where or where query so it should be a nice addition in my opinion.

juniorb2ss commented 7 years ago

Something like ?name=Jhon&orName=Micael

or maybe ?name=(Jhon|Micael)

result: where (name = 'Jhon' OR name = 'Micael')

alekslyse commented 7 years ago

Yes, actually both would be good.

selahattinunlu commented 7 years ago

@alekslyse @juniorb2ss

Hi guys. Firstly, thanks for suggestion! You can use "whereIn" to make this.

/api/users?age[]=18&age[]=23 The resulting query = Users::whereIn('age', [18, 23])

It gives same result exactly.

https://github.com/selahattinunlu/laravel-api-query-builder/wiki/Other-Examples#where-queries

selahattinunlu commented 7 years ago

I think issue is resolved. But if you don't think like me please open again.