It looks to me that you really need a belongsToMany() with some extra consideration for the user_role
property, something like:
public function projects()
{
return $this->belongsToMany('Project')->withPivot('user_role');
}
hasManyThrough() is just shortcut for jumping across two One-to-Many relationships. For example, a User has many Posts and a Post has many Comments. You could set up a hasManyThrough() relationship to see all of the Comments made on all Posts by a User.
Hope this helps.
See my response in http://laravel.io/forum/03-04-2014-hasmanythrough-with-many-to-many
Laravel I think not support this. See a hack at http://damien-louvard.fr/laravel-extends-model-hasmanythrough-3-parameters/
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community