Nope, no go. Tried naming it scopeTest()
and trying $players->contest->test()
, still undefined method:
Call to undefined method Illuminate\Database\Eloquent\Collection::test()
$players->contest()->test()->get();
$players->contest; // shortcut for $players->contest()->get();
Doh. Yeah, parantheses on $player->results()
was the issue.
I'm coming from Ruby where we don't have to deal with this "methods are different from attributes" stuff. Didn't even notice the use of parentheses in the documentation for query scopes.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community