You are calling a function (query builder) on your relationships. You really need to just...
Step::find(1)->connections->connectionSteps;
Laravel does the magic behind the scenes.
I can't remeber of the top of my head, but if you want to use the current code you have, add ->get() to the end and that should work.
Step::find(1)->connections()->connectionSteps()->get();
Hope it helps.
You could use eager loading aswell, I find this helpful when I want to load more than one relationship.
Step::with('connections')->where('id', 1)->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community