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

Have you even attempted a dd or print_r to test results that way?

0

Using tinker

App\Administrator::find(1)->subordinates

gives me the same error "LogicException with message 'Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation'"

while

App\Administrator::find(1)->subordinates()

works!

0

Check laracast for videos on relations, I know sometimes you put the () and sometimes not. Been a while since I viewed it.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

xGeek xgeek Joined 22 Apr 2015

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.