samedi 4 juin 2016

Angularjs send parameters array to laravel GET route

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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1UnQ7VD
via IFTTT

Aucun commentaire:

Enregistrer un commentaire