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;
        }
    }
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
Get the user s role on a given team .