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