I just migrated to Laravel from Django. I am not sure how to send variable number of parameters through my AJAX request from Angularjs to a GET method in Laravel.
I have a certain number of filters to a list and I only want to send those that are not undefined, along with their key, so that I can directly do this:
Group::where($filters)->get();
$filters is the array I intent to send through Angularjs, which will be something like
['group_id'=>101,'Country'=>'India']
Or whatever syntax it requires.
Also, how exactly do I specify this in my get route in route.php?
EDIT:
I know I can always go with the optional parameters and if else, but there has got to be a better way, isn't there?