# $cart->random()

> Returns a new collection consisting of random elements, from the original collection, shuffled or ordered

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

```php
$cart->random(int $count = 1, bool $shuffle = false): Kirby\Toolkit\Collection
```

## Parameters

| Name | Type | Default |
| --- | --- | --- |
| `$count` | `int` | `1` |
| `$shuffle` | `bool` | `false` |

## Return type

`Kirby\Toolkit\Collection`

## Parent class

`Wagnerwagner\Merx\Cart` inherited from `Kirby\Toolkit\Collection`
