Description
Been pulling my hair out all night on this one. I created a little BatchController for executing rest calls in a group. It utilizes the Internal Routes. It works great on homestead but fails on forge. To use the BatchController I make a post to BatchController.store() and in the body is a json object with multiple routes specified. The store() function pulls the json apart and makes the appropriate internal route calls.
I have narrowed it down. On forge the Request object on the internal route contains parameters equivalent to the the original json object that was sent to the BatchController store() function. On homestead the parameters are properly empty. Below is a snippet of the BatchController. Any help is much appreciated, can't seem to narrow it down anymore. When I dump the dispatcher before making the internal route call it has the json object as content, and no parameters. After making the internal route call if I dump the dispatcher, it has parameters equivalent to the json object.
class BatchController extends AbstractControllerBase
{
public function store(Request $request) {
$dispatcher = app('Dingo\Api\Dispatcher');
$result = [];
$batchRequests = json_decode($request->getContent());
$request->replace([]);
foreach ($batchRequests->requests as $batchRequest) {
$response = $dispatcher->get($batchRequest->endpoint, []);
$result = array_add($result, $response);
}
return $result;
}
}