Skip to content

Commit ced5810

Browse files
Update readme & changelog
1 parent 684c427 commit ced5810

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to `laravel-collection-macros` will be documented in this file
44

5+
## 3.3.0 - 2017-10-17
6+
- Added `at`
7+
58
## 3.2.0 - 2017-10-11
69
- Added `rotate`
710

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The package will automatically register itself.
3535
## Macros
3636

3737
- [`after`](#after)
38+
- [`at`](#at)
3839
- [`before`](#before)
3940
- [`chunkBy`](#chunkby)
4041
- [`collect`](#collect)
@@ -86,6 +87,18 @@ $currentItem = 3;
8687
$collection->after($currentItem, $collection->first()); // return 1;
8788
```
8889

90+
### `at`
91+
92+
Retrieve an item at an index.
93+
94+
```php
95+
$data = new Collection([1, 2, 3]);
96+
97+
$data->at(0); // 1
98+
$data->at(1); // 2
99+
$data->at(-1); // 3
100+
```
101+
89102
### `before`
90103

91104
Get the previous item from the collection.

0 commit comments

Comments
 (0)