Support the ongoing development of Laravel.io →
posted 9 years ago
Eloquent
Last updated 2 years ago.
0
Solution

I've not tested non int relations, but I doubt it will cause an issue - as long as they are unique obviously.

It could be the way you are querying the data. When you use user() vs user, different methods are used.

Try...

\Profile::find(1)->user->related // do you get any results with this?
0

T2theC said:

I've not tested non int relations, but I doubt it will cause an issue - as long as they are unique obviously.

It could be the way you are querying the data. When you use user() vs user, different methods are used.

Try...

\Profile::find(1)->user->related // do you get any results with this?

Thank you, I didn't notice that variable presentation should be used when calling a relationship

0

Sign in to participate in this thread!

Eventy

Your banner here too?

orb08 orb08 Joined 10 Dec 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.

© 2024 Laravel.io - All rights reserved.