Skip to content

Commit

Permalink
Merge pull request #19 from joshembling/main
Browse files Browse the repository at this point in the history
Adds extended team squads
  • Loading branch information
PyaeSoneAungRgn committed Aug 22, 2024
2 parents 76f4230 + 78c4c14 commit cc035dc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/src/team-squads.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ SportmonksFootballApi::teamSquad()->all();
use SportmonksFootballApi;

SportmonksFootballApi::teamSquad()->byTeamIdAndSeasonId($teamId, $seasonId);
```
```

## GET Extended Team Squads by Team ID

```php
use SportmonksFootballApi;

SportmonksFootballApi::teamSquad()->extendedByTeamId($teamId);
```
7 changes: 7 additions & 0 deletions src/Resources/TeamSquadResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ public function byTeamIdAndSeasonId(int|string $teamId, int|string $seasonId): a
url: "football/squads/seasons/{$seasonId}/teams/{$teamId}"
);
}

public function extendedByTeamId(int|string $teamId): array
{
return $this->get(
url: "football/squads/teams/{$teamId}/extended"
);
}
}
6 changes: 6 additions & 0 deletions tests/Feature/TeamSquadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@
seasonId: 718
))->toBeArray();
});

it('can get extended team squads by team id', function () {
expect(football()->teamSquad()->extendedByTeamId(
teamId: 1
))->toBeArray();
});

0 comments on commit cc035dc

Please sign in to comment.