Redigerat:
$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']);
Redigerat:
$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']);