mnabialek / laravel-eloquent-filter

Filter Eloquent data
MIT License
25 stars 11 forks source link

cannot change value of ignoreEmptyFilters flag #8

Open TheAliAbbasi opened 6 years ago

TheAliAbbasi commented 6 years ago

Hey there, thank you for your awesome package there's one thing I couldn't figure out on my own. If you look at thist file mnabialek/laravel-eloquent-filter/src/Parsers/SimpleQueryParser.php Line:44 there's a flag for ignoring empty values but I can't seem to find the right place to change it

mnabialek commented 6 years ago

Hi

You can just create custom SimpleQueryFilter and pass custom SimpleQueryParser that extends from original SimpleQueryParser.php but sets this property to true. See https://github.com/mnabialek/laravel-eloquent-filter#customization for details

TheAliAbbasi commented 6 years ago

that's actually what I ended up doing, since I needed to implement a few more filters

Thanks

TheAliAbbasi commented 6 years ago

but It would have been nice to have config file to set these flags accordingly

mnabialek commented 6 years ago

@TheAliAbbasi Thank you for suggestion. Maybe I will consider adding this in future.