# $taxRules->group()

> Groups the items by a given field or callback. Returns a collection with an item for each group and a collection for each group.

- Source: `src/Cms/Collection.php#L168` <https://github.com/getkirby/kirby/blob/6.0.0-beta.1/src/Cms/Collection.php#L168>
- Inherited from Kirby, not part of the Merx API. See <https://getkirby.com/docs/reference>.

```php
$taxRules->group(string|Closure $field, bool $caseInsensitive = true): Kirby\Cms\Collection
```

## Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `$field` | `string\|Closure` | `–` |  |
| `$caseInsensitive` | `bool` | `true` | Ignore upper/lowercase for group names |

## Return type

`Kirby\Cms\Collection`

## Exceptions

| Type | Description |
| --- | --- |
| `Exception` |  |

## Parent class

`Wagnerwagner\Merx\TaxRules` inherited from `Kirby\Cms\Collection`
