How do i modify query parameters ? #728
Unanswered
YunigeCDilip
asked this question in
General
Replies: 1 comment
-
I think this behavior can not be introduced in the package by default. If you really want you could, however, add a custom middleware that automatically adds those 'unknown' parameters as filters: // A middleware that achieves this behavior (may have unintended consequences!)
class UseAllParamsAsDefaultFilters
{
public function handle(Request $request, Closure $next)
{
$request->query->set('filter', $request->query->all());
return $next($request);
}
}
// Now ?name=dominikb works just like ?filter[name]=dominikb |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Instead of using
users?filter[name]=Joe&filter[position]=developer
can we make it to:
users?name=Joe&position=developer
Beta Was this translation helpful? Give feedback.
All reactions