Support the ongoing development of Laravel.io →
posted 3 months ago
Eloquent
Last updated 3 months ago.
1
moderator Solution

You can use a with to load the relations in your query:

$memberResult = Member::with('addresses', 'phones', 'emails')->all();

(I assume that the relation functions on your member model are named addresses, phones and emails)

3
Solution selected by @jtsimon93

Thank you @tvbeek

I was able to get it working by using:

$memberResult = Member::with('addresses', 'phones', 'emails')->get();

I really appreciate your help!!

2

Sign in to participate in this thread!

LoadForge

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 Laravel.io - All rights reserved.