Laravel-5.6-and-Vue.j-2-Dataviewer-Advanced-Filter
Laravel-5.6-and-Vue.j-2-Dataviewer-Advanced-Filter copied to clipboard
Small bug in code here on git
In here
public function apply($query, $data)
{
if(isset($data['f'])) {
foreach($data['f'] as $filter) {
$filter['match'] = isset($filter['filter_match']) ? $ $filter['filter_match'] : 'and'; //here is the thing
$this->makeFilter($query, $filter);
}
}
return $query;
}
instead of
$filter['filter_match']
it should be
$data['filter_match']
And by the way, one more thank for sharing this. It is an amazing job, I've learned a lot using your video and this code.
Best regards
@Dach0 Well I don't think this repo is active but as to your query/ suggestion. with your suggestion the filter_match
will be applied to all the queries. with authors method, we need to add individual filter_match
like f[1][filter_match]=or
and so for each query*
in the in the prams. so gives more control.
Mhm, probably it's not active anymore. It has been a long time since I used it, and I've made some changes and updates locally, kind of a fork, so can't give some updated/useful comments. But very useful content here.