Level 14
You can pass an array of relationships to the with method.
Eager Loading Multiple Relationships
$books = App\Book::with(['author', 'publisher'])->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello , i'm working on a laravel project in which i have three tables module section and data
module hasmany sections and section hasmany datas
is there a way to do something like this merge the two hasmany module::with('sections')->with('datas')->get();
Please or to participate in this conversation.