Modificato:
$team = Team::find($id);
$users = User::join('teams', 'teams.id', '=', 'users.team_id')
->whereBetween('teams.l', [$team->l, $team->r])
->get(['users.id', 'users.username']);
Modificato:
$team = Team::find($id);
$users = User::join('teams', 'teams.id', '=', 'users.team_id')
->whereBetween('teams.l', [$team->l, $team->r])
->get(['users.id', 'users.username']);