From e0c3689d2aed9223bc161e79ac286f48da130e73 Mon Sep 17 00:00:00 2001 From: Alexmg86 Date: Fri, 16 Sep 2016 18:00:38 +0300 Subject: [PATCH] Update UsedByTeams.php it's will be work with Join --- src/Mpociot/Teamwork/Traits/UsedByTeams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mpociot/Teamwork/Traits/UsedByTeams.php b/src/Mpociot/Teamwork/Traits/UsedByTeams.php index 7a1518d..b328ef1 100644 --- a/src/Mpociot/Teamwork/Traits/UsedByTeams.php +++ b/src/Mpociot/Teamwork/Traits/UsedByTeams.php @@ -26,7 +26,7 @@ protected static function bootUsedByTeams() static::addGlobalScope('team', function (Builder $builder) { static::teamGuard(); - $builder->where('team_id', auth()->user()->currentTeam->getKey()); + $builder->where($builder->getQuery()->from . '.team_id', auth()->user()->currentTeam->getKey()); }); static::saving(function (Model $model) {