Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Eager Loading は、Laravel のドキュメントに明確に記載されているように、IN(...) 句内の親テーブルの主キーを使用します。
select * from books select * from author where book_id in (1, 2, 3, 4, 5, ...)
select * from books
select * from author where book_id in (1, 2, 3, 4, 5, ...)
これに主キーを使用せずに、books テーブルの別のキーを使用することは可能ですか? それとも、ピボット テーブルから取得したキーでさえありますか?