Report added filter => old and request inputs support
This commit is contained in:
parent
0289cb3b15
commit
cfd4b0ce16
@ -27,6 +27,35 @@ class AddSearchString extends Listener
|
||||
return;
|
||||
}
|
||||
|
||||
$old = old();
|
||||
$request = request()->all();
|
||||
|
||||
if ($old || $request) {
|
||||
$input = request('search');
|
||||
|
||||
$filters = [];
|
||||
|
||||
if ($input) {
|
||||
$filters = explode(' ', $input);
|
||||
}
|
||||
|
||||
foreach ($old as $key => $value) {
|
||||
$filters[] = $key . ':' . $value;
|
||||
}
|
||||
|
||||
foreach ($request as $key => $value) {
|
||||
if ($key == 'search') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$filters[] = $key . ':' . $value;
|
||||
}
|
||||
|
||||
request()->merge([
|
||||
'search' => implode(' ', $filters)
|
||||
]);
|
||||
}
|
||||
|
||||
// Apply search string
|
||||
$this->applySearchStringFilter($event);
|
||||
}
|
||||
|
@ -73,6 +73,14 @@
|
||||
'value' => \Date::now()->year,
|
||||
];
|
||||
}
|
||||
|
||||
if (old($key) || request()->get($key)) {
|
||||
$filtered[] = [
|
||||
'option' => $key,
|
||||
'operator' => '=',
|
||||
'value' => old($key, request()->get($key)),
|
||||
];
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user