Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

464
Visualizações
Apache and PHP - My server returns an empty response without telling me why

I've been banging my head all day and can't seem to figure this one out.

I have this code:

public function getUsers()
    {
        $company_id = 21;
        $users = User::with('user_details',
            'user_details.department',
            'user_details.payroll_group',
            'user_details.shift_group',
            'user_details.updated_by')
            ->with('deductions')
            ->with('allowances')
            // ->with('shifts')
            ->where('company_id', $company_id)
            ->get();

        foreach ($users as $key => $user) {
            $user->getFirstMedia('images');

            if(isset($user->media[0])){

                $users[$key]->media[0]->url = $user->media[0]->getFullUrl();
            }

            $users[$key]['user_salary'] = UserSalary::getCurrentRate($user->id);
        }

        return response()->json($users, 200);
    }

It seems that everytime that $company_id has a value of 21 my server always response is empty. BUT if not, it returns as what I've expected.

I tried it in postman, this is the result:

enter image description here

I also tried running curl in my server, it responds this one:

curl: (52) Empty reply from server

I've checked laravel.log, there's no error. I've checked /var/log/apache2/error.log, there's no error also.

I ran out of ideas how to solve this one.

Help me, please! Thanks.

PS: I don't know if i should post this one here or at ServerFault, but here it goes.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda