how can i make filter , search , sort functionality in blade , i am not using api
I want to implement search functionality along with sorting (orderBy) and pagination (per page). However, I'm having trouble customizing the query string in my Blade form to support all of these features. For example, I am using the Spatie Laravel Query Builder package, which expects URLs in this format:
GET /users?filter[name]=john&filter[email]=gmail
How can I customize my form’s GET request query string to match this format properly?
// GET /users?filter[name]=john&filter[email]=gmail
I have another issue related to making the query string in the URL dynamic. For example, when I use a search input, the URL becomes http://localhost?search=value. If I also apply sorting, it becomes http://localhost?search=value&sort=value. What I want is for each parameter—like search or sort—to appear in the URL only if it's selected or filled in.
@minaremonshaker Don’t over-think things. If a parameter doesn’t have a value that it will just be disregarded. If you submit a form, then all fields’ values will be submitted. That’s just how forms work.