Tucker-Eric / EloquentFilter

An Eloquent Way To Filter Laravel Models And Their Relationships
http://tucker-eric.github.io/EloquentFilter
MIT License
1.72k stars 120 forks source link

Array automatic null filter #143

Closed simon28082 closed 4 years ago

simon28082 commented 4 years ago

Sometimes, we pass in an array, but there may be some null values ​​in the array, which are often passed in by some request parameters, such as:

$array = ['times' => ['start_time' =>'', ' end_time' => '2020-08-11'],'name' =>'','sex' => 1]

if the start and end time in times are all empty, we hope the program will automatically Filter out, useless empty array

Tucker-Eric commented 4 years ago

I don't think this is something we'd be willing to merge due to the fact it modifies the values passed to the filter. I'd like to stay away from modifying any values and ensure those values are passed to filter methods as is, so developers can decide how they'd like to handle their own logic in their filter's methods.

simon28082 commented 4 years ago

Well, I'm going to close this PR