laravel-eloquent-filter icon indicating copy to clipboard operation
laravel-eloquent-filter copied to clipboard

cannot change value of ignoreEmptyFilters flag

Open TheAliAbbasi opened this issue 6 years ago • 4 comments

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

TheAliAbbasi avatar Jun 30 '18 07:06 TheAliAbbasi

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

mnabialek avatar Jun 30 '18 09:06 mnabialek

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

Thanks

TheAliAbbasi avatar Jun 30 '18 13:06 TheAliAbbasi

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

TheAliAbbasi avatar Jun 30 '18 13:06 TheAliAbbasi

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

mnabialek avatar Jul 08 '18 12:07 mnabialek