0

I'm Working on rest API. I need To Pass Array Like [1,2,3]

enter image description here

That Course Return in $request->course

After I Run For each Loop That is Show

foreach ($request->course as $key => $value) {
                 echo $value;die;
                }

its Show Invalid argument supplied for foreach()

Thank You

Pul Teno
  • 31
  • 3

1 Answers1

0

By passing [1,2,3] in course your as sending a string.

You should look at Send an Array with an HTTP Get to find a solution.

To answer to your question, you should send 3 parameters :

course[]=1
course[]=2
course[]=3
Yoleth
  • 1,269
  • 7
  • 15