Skip to content

Commit

Permalink
Merge pull request #345 from Jacq/master
Browse files Browse the repository at this point in the history
When using an auth.model that is not of "Users" the pivot id is incorrectly assumed as 'role_user'
  • Loading branch information
andrewelkins committed Aug 7, 2015
2 parents a6b4d81 + 6919d48 commit 62c1848
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Entrust/Traits/EntrustRoleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ trait EntrustRoleTrait
*/
public function users()
{
return $this->belongsToMany(Config::get('auth.model'), Config::get('entrust.role_user_table'));
return $this->belongsToMany(Config::get('auth.model'), Config::get('entrust.role_user_table'),'role_id','user_id');
// return $this->belongsToMany(Config::get('auth.model'), Config::get('entrust.role_user_table'));
}

/**
Expand Down

0 comments on commit 62c1848

Please sign in to comment.