Reputation: 16
How to get multiple argument values in Laravel 5.2?
Example:
http://localhost:8000/print?id=1&id=3
How get the values of id
s in an array let's say [1,2]
?
Upvotes: 0
Views: 240
Reputation: 17668
You can send the data using []
in the url as:
http://localhost:8000/print?id[]=1&id[]=3
Then you can get it in controller as:
$request->get('id') // returns [1,3]
Upvotes: 3