Support the ongoing development of Laravel.io →
posted 1 year ago
Eloquent
Last updated 1 year ago.

syq246 liked this thread

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)

jtsimon93, nickopris, syq246 liked this reply

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!!

tvbeek, syq246 liked this reply

2

Sign in to participate in this thread!

Eventy

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.

© 2024 Laravel.io - All rights reserved.