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

Where the nested relation Model dose not work properly with inertiajs. #154

Closed devbapidey closed 3 years ago

devbapidey commented 3 years ago

laravel 8.33 eloquent-filter 2.4.6

I am using eloquent-filter with inertiajs. Now using array query string like this item[price] is not possible in .vue file. I have to convert it to a string like 'item[price]'.

So my final method in vue file look like this methodName(){ this.$inertia.get({ data: { item[price]: this.item.price, }, }) }

But problem is when I select different price it send &item[price]=100&item[price]=200 and this is default behavior of inertiajs, Which I don't want. Is it possible to use different identifier for nested relation Model?

mehdi-fathi commented 3 years ago

@devbapidey You can make a new array before the filter and pass it to the filter method.