Skip to content

Commit

Permalink
docs: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepimpao committed May 28, 2024
1 parent 8e87549 commit 983de97
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions docs/03-supported-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,7 @@ withPage(int $page): self
Determine the results page number.

```php
// show page 2 of the results
$api->fixtures()
->withPage(2)
->getAll();
Expand All @@ -1727,6 +1728,7 @@ Determine the number of results per page.
Please note that it only affects the results of the base entity, so includes are not paginated.

```php
// show 50 entries per page
$api->fixtures()
->withPerPage(50)
->getAll();
Expand All @@ -1738,33 +1740,34 @@ $api->fixtures()
withSortBy(string $sortBy): self
```

Specifies the field by which the data will be sorted. Currently supported fields include:
- `starting_at`
- `name`
Specifies the field by which the data will be sorted.

```php
// results sorted by the "starting_at" field
$api->fixtures()
->withSortBy('starting_at')
->getAll();
```

For all available sorting options, check the [official documentation](https://docs.sportmonks.com/football/api/request-options/ordering-and-sorting).

#### `withOrder`

```php
withOrder(string $order): self
```

Determines the order in which the data will be sorted. Options are between ascending and descending:
- `asc`
- `desc`

Determines the order in which the data will be sorted.

```php
// results in descending order
$api->fixtures()
->withOrder('desc')
->getAll();
```

For all available order options, check the [official documentation](https://docs.sportmonks.com/football/api/request-options/ordering-and-sorting).

#### `withPagination`

```php
Expand Down Expand Up @@ -1809,6 +1812,8 @@ $api->fixtures()
->getById(1);
```

To better understand how it works, check the [official documentation](https://docs.sportmonks.com/football/api/request-options/selecting-fields).

#### `withInclude`

```php
Expand All @@ -1817,7 +1822,7 @@ withInclude(string $include): self

Includes allow to enrich the response with relational data.
This means that it is possible to request a fixture and have the venue data in the same response without any additional requests.
To check what includes ara available per endpoint, check the [official documentation](https://docs.sportmonks.com/football/endpoints-and-entities/endpoints).
To check what includes ara available per endpoint, check the following [documentation](https://docs.sportmonks.com/football/endpoints-and-entities/endpoints).

```php
// get fixture with "venue" and "participants" (teams) data
Expand Down

0 comments on commit 983de97

Please sign in to comment.