return Event::with('city.companies.persons')->get();如果只想从
persons表中选择某些字段,请使用以下命令:
return Event::with(['city.companies.persons' => function ($query) { $query->select('id', '...');}])->get();
return Event::with('city.companies.persons')->get();如果只想从
persons表中选择某些字段,请使用以下命令:
return Event::with(['city.companies.persons' => function ($query) { $query->select('id', '...');}])->get();