mehdi-fathi/eloquent-filter

Nested relation Model and LIKE

Nexulo opened this issue · 3 comments

The filter function of relation Model works well.
But it does not work if you want to use the LIKE operator instead of "=".

So i'd like to query "WHERE column LIKE '%value%'" instead of "WHERE column = '%value%'".

Example:
https://....index?location[locationName][name][like]=%Sacram%

That does not work and i get the error that the column 'like' does not exist, which makes sense.

Without [like] in the url it makes the right query, but then it will only filter for exactly %Sacram%.

@maisen20 I can't implement everything you need. You can create a custom query in these cases. I added another feature to inject query conditions yourself. But I don't release that yet. probably I will release that this week. so the custom query can do it.

I understand that and it was also more an indication for possible future adjustments.
Thank you and best regards,
maisen20

@maisen20 you should update eloquent filter and read https://github.com/mehdi-fathi/eloquent-filter#Custom-Detection-Condition for more details.