yogeshgalav's avatar

Eloquent Load not working

I'm running the following code in controller

return response()->json([
            'data' => $medical_institute->load([
                'doctors:id,name,name_kana',
            ])
        ]);

This is running query as per laravel telescope

select
  "id",
  "name",
  "name_kana"
from
  "doctors"
where
  "doctors"."medical_institute_id" in (80)

Which is returning results in pgadmin but not returning here anything with load, Even the following query is also returning results

        $medical_institute->doctors = $medical_institute->doctors()->get(['id', 'name', 'name_kana']);

But I expect "load" to return same results.

0 likes
1 reply

Please or to participate in this conversation.