Json responses are braking/partially returned - Laravel 5.3

137 views Asked by At

I have JSON data. if I dd() the response I can see the complete json, but if I return it as a JSON response the json is braking/partially returned/truncated and also it's not a valid json. Screenshot - end of JSON response.Below is the code I am using

public function getLocations($json = true)
{
    $locations = [
        'countries'     => $this->mobileAppController->getCountries(),
        'states'        => $this->mobileAppController->getStates(),
        'cities'        => $this->mobileAppController->getCities(),
        'regions'       => $this->mobileAppController->getRegions()
    ];
    //dd(response()->json($locations));
    return $json ? response()->json($locations) : $locations;
}

I have a homestead installation. and a staging environment. in local/homestead everything works fine. the response is completely returned. the staging is an envoyer server. There the response is truncated/braking/partially returned. what might be the problem.?

0

There are 0 answers