0

I use this laravel query in my code :

        $teamRoles = TeamMembers::where('is_active',config('constants.status.enable'))
           ->get();
        dd($teamRoles);

I don't know why this result return HTTP ERROR 500 but when I use ->find() or ->first() instead of ->get() that works fine.

Zahra Badri
  • 1,656
  • 1
  • 17
  • 28

1 Answers1

0

The problem was for php memory size; I change memory_size in php.ini and it solve.

Zahra Badri
  • 1,656
  • 1
  • 17
  • 28
  • 1
    Are you fetching all(at least 1000 or more) records at once? If yes, I am afraid, this isn't the correct way. You may want to paginate them. – nice_dev Sep 30 '19 at 09:20
  • @vivek_23 yes that's not the correct way but that was at first in my query and I didn't set other conditions yet. – Zahra Badri Oct 01 '19 at 06:13