Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

465
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda