mehdi-fathi / eloquent-filter

Eloquent Filter is a package for filter data of models by the query strings. Easy to use and fully dynamic.
https://mehdi-fathi.github.io/eloquent-filter/
MIT License
436 stars 42 forks source link

In Your Like condition, This Dependency Block the " Delhi " word in Query show empty result but exist data #169

Closed Deepakcyber closed 3 years ago

Deepakcyber commented 3 years ago

test.com/api/v1/testas?a_state[like]=%Delhi% through postman show empty { "data": [] } but in other state show data . and all city existed only problem with delhi . using your default condition of where like

mehdi-fathi commented 3 years ago

@Deepakcyber first fix your issue later i will read it.Otherwise i have to close your issue

Deepakcyber commented 3 years ago

ver 2.3.0 when using your docs like query
test.com/api/v1/testas?a_state[like]=%Delhi% this show empty result .. above site name changed . but if this have test.com/api/v1/testas?a_state[like]=%Haryana% means other states from delhi it show data . but a_state field have all state . It show Problem in only Delhi

mehdi-fathi commented 3 years ago

@Deepakcyber Your problem is not related to eloquent filter. We have many unit tests for all featuers. I suggest checking your data and check the query generated.

Deepakcyber commented 3 years ago

i make normal query of like field name ad_state and this gave me data in "DELHI" but eloquent filter not give data $employees = Bey_ad::latest()->where('ad_state', 'like', '%' .$search . '%')->limit(5)->get();
this my query gave me result . But eloquent filter not . Your Eloquet Qyery Below return new BeyResource(Bey_ad::latest()->filter($request->except(['_token']))->with('ad_cats','ad_scats','created_by')->where('bad_status', '=', 'Approve')->get());

Deepakcyber commented 3 years ago

??

mehdi-fathi commented 3 years ago

@Deepakcyber We don't have any problem in the like query in the eloquent filter.

Deepakcyber commented 3 years ago

@mehdi-fathi what is wrong in my query ? only block delhi word in state but show data with my normal query?? evrything done as your query