> For the complete documentation index, see [llms.txt](https://teamleader-sdk.mcore-services.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://teamleader-sdk.mcore-services.dev/api-reference/products/units-of-measure.md).

# Units of Measure

Manage units of measure in Teamleader Focus — read-only, and unpaginated: list() returns every unit in one response and accepts no arguments.

```php
Teamleader::unitsOfMeasure()
```

|                          |                                                                |
| ------------------------ | -------------------------------------------------------------- |
| Class                    | `McoreServices\TeamleaderSDK\Resources\Products\UnitOfMeasure` |
| Create / update / delete | — / — / —                                                      |
| Pagination               | No                                                             |

## Endpoints

* `unitsOfMeasure.list`

## Filters

`list()` takes no filters.

## Methods

### `list()`

```php
list(array $filters = [], array $options = []): array
```

List all units of measure

`unitsOfMeasure.list` takes no request body at all — the API specification declares no filter, page or sort parameter for it. The inherited signature still offers them, so arguments are rejected rather than discarded: before v2.1.2 they were dropped silently, and every call returned the complete list regardless of what was asked for.

* `$filters` — Must be empty — this endpoint accepts no filters
* `$options` — Must be empty — this endpoint accepts no sorting or pagination

**Throws** `\InvalidArgumentException` When any argument is passed

### `info()`

```php
info($id, $includes = null): array
```

Units of measure have no info endpoint

`unitsOfMeasure.list` is the only endpoint Teamleader exposes for this resource. Use findById(), which resolves against the full list.

**Throws** `\InvalidArgumentException` Always

### `findByName()`

```php
findByName(string $name): ?array
```

Find a unit of measure by name (case-insensitive search)

* `$name` — The name to search for

### `findById()`

```php
findById(string $id): ?array
```

Find a unit of measure by ID

* `$id` — The ID to search for

### `asOptions()`

```php
asOptions(): array
```

Get units of measure as key-value pairs (id => name) for use in dropdowns

### `asCollection()`

```php
asCollection(): Collection
```

Get units of measure as collection for easier manipulation

### `exists()`

```php
exists(string $name): bool
```

Check if a unit exists by name

### `count()`

```php
count(): int
```

Get the total count of units of measure

## Examples

Get all units of measure:

```php
$unitsOfMeasure = Teamleader::unitsOfMeasure()->list();
```

Find unit of measure by name:

```php
$unit = Teamleader::unitsOfMeasure()->findByName("piece");
```

Get units as key-value pairs for dropdowns:

```php
$options = Teamleader::unitsOfMeasure()->asOptions();
```
