Skip to content

Commit

Permalink
docs: updated cities resource
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepimpao committed May 16, 2024
1 parent 4462b6d commit 721baad
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions docs/03-supported-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -1934,22 +1934,17 @@ foreach ($odds->getData() as $odd) {
### Cities

- [Official documentation](https://docs.sportmonks.com/football/v/core-api/endpoints/cities)
- Cache default max age: `1 day`

#### `getAll`

```php
getAll(int $page = 1, int $perPage = 25, string $order = 'asc'): CityCollection
getAll(): CityCollection
```

Get all cities:

```php
$cities = $sportMonksFootball->cities()->getAll();

foreach ($cities->getData() as $city) {
echo $city->getName();
}
$response = $api->cities()->getAll();
```

#### `getById`
Expand All @@ -1961,24 +1956,19 @@ getById(int $id): CityItem
Get city by id:

```php
$city = $sportMonksFootball->cities()->getById(1);
echo $city->getData()->getName();
$response = $api->cities()->getById(1);
```

#### `getAllBySearchQuery`

```php
getAllBySearchQuery(string $query, int $page = 1, int $perPage = 25, string $order = 'asc'): CityCollection
getAllBySearchQuery(string $query): CityCollection
```

Get all cities by search query:

```php
$cities = $sportMonksFootball->cities()->getAllBySearchQuery('lisbon');

foreach ($cities->getData() as $city) {
echo $city->getName();
}
$response = $api->cities()->getAllBySearchQuery('lisbon');
```

### Continents
Expand Down

0 comments on commit 721baad

Please sign in to comment.