Support the ongoing development of Laravel.io →

brunodevel

Joined 22 Jan 2015

Statistics

Threads 1
Replies 3
Solutions 1
Articles 0

[ELOQUENT] belongsTo() not returning relationships

Hello everyone! I have the following models. Product.php class Product extends Eloquent { protected...

0 Likes
4 Replies
Solved
replied 9 years ago

[ELOQUENT] belongsTo() not returning relationships

Solved! I just changed the method name of the relationship to something other than the column name p...

0 Likes
Solved
replied 9 years ago

[ELOQUENT] belongsTo() not returning relationships

If i do this: echo $p->category()->first()->name; I can get the category. But with this I'...

0 Likes
replied 9 years ago

[ELOQUENT] belongsTo() not returning relationships

epetykom said: First for check you can try $p->category, I $p->category is non-object so you...

0 Likes

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.