• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

398
Views
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.

about 3 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error