Hi

In this case the $invite is of type TeamInvite, this model is extended form a model that is in a package, and that model have a trait that defines the relationship to team like this:
class TeamInvite extends \Mpociot\Teamwork\TeamInvite
\Mpociot\Teamwork\TeamInvite has this:
use TeamworkTeamInviteTrait;
and in the trait you have this:
public function team()
{
return $this->hasOne(Config::get('teamwork.team_model'), 'id', 'team_id');
}