Support the ongoing development of Laravel.io →
posted 10 years ago
Eloquent

Any thoughts on loading a "Type" for this $user->phones->type so the output of User (which is working btw) would not only show the phone and the phones type id but the name of the type. An example is here https://www.dropbox.com/s/ie4hqfo9op71bhw/phone_types.png

So the Users hasMany Phones and Phones belongsTo PhoneTypes (Home, Work, Office)

Thanks

Last updated 2 years ago.
0

I was able to load this using the dot notation as deep as needed etc phone.phone_types

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

alnutile alnutile Joined 3 Feb 2014

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.

© 2025 Laravel.io - All rights reserved.