Define route in Laravel with multi parameters for multi conditions in query
i have a table user in database and i want to define a route to query users in table with different "where" conditions passed by url. Example i want to query users with only 2 conditions B and C but sometimes i want to query users with 3 or more conditions like B, C and D .... How should i define a route or some routes to solve this problem. Thank you for reading!
Using query parameters. What you are describing is still an index action; so I would suggest you filter the Eloquent/Database query using query parameters:
How you handle the query filtering in the Controller is up to you; this video tutorial describes creating Filter classes so that you have some control over the query parameters than can be handled