0
この私の雄弁なクエリ:laravel 5.5でeager loadingのフラットアレイを取得する方法は?
$data = Disciplines::where('type', '<>', 'Initiator')
->with(['discipline_boxes.assign.box' => function($query) {
$query->select('id');
}])
->get();
return $data;
iはボックス関係 のIDの唯一の配列を返したい例えば:[2,3,4,5]
いない「 - >のtoArray()」作業? – Amarnasan
すべてのドキュメントがあります。読み込んで実装してください:https://laravel.com/docs/5.5/eloquent-relationships#eager-loading –
これらのすべての関係の逆を定義していますか? – lagbox