app/Teams/CanJoinTeams.php
public function teamRole($team)
    {
        $team = $this->teams->find($team->id);

        if ($team) {
            return $team->pivot->role;
        }
    }
public function teamRole($team)
    {
        $team = $this->teams->find($team->id);

        if ($team) {
            return $team->pivot->role;
        }
    }
Get the user's role on a given team.

@param  \Laravel\Spark\Teams\Team  $team
@return string