3

So i'm a laravel dev and i love it. However one thing that only seems to happen late at night is when working with Eloquent i always end up putting () when working with relationships.

Last night i spent about 2 hours messing with

public function members(){
return $this->hasManyThrough(
'App\Member', 'App\ConversationMember',
'conversation_id', 'id', 'id'
);
}

only to find out i was calling it via
$conversation->members() instead of $conversation->members

This morning when i opened up the IDE i immediately figured out what i was doing wrong.... sometimes burning the late night oil is counter productive i guess you could say

Comments
Add Comment