There are various ways to do this, but they depend on what exactly is handling the response. The simplest way is to build an array of return values inside the loop and then return all of them outside the loop.
$input = Input::except('_token');
$response = [];
foreach ($input as $key => $value) { $response[] = Response::json(['Filename: ' . $key]); }
return $response;
the parsing of the reponse didn't work, it returns an empty array :/
If you use array_push() in the loop it will append to the array--the existing code appears to reset the array every iteration.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community