File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to ` laravel-collection-macros ` will be documented in this file
4
4
5
+ ## 3.3.0 - 2017-10-17
6
+ - Added ` at `
7
+
5
8
## 3.2.0 - 2017-10-11
6
9
- Added ` rotate `
7
10
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ The package will automatically register itself.
35
35
## Macros
36
36
37
37
- [ ` after ` ] ( #after )
38
+ - [ ` at ` ] ( #at )
38
39
- [ ` before ` ] ( #before )
39
40
- [ ` chunkBy ` ] ( #chunkby )
40
41
- [ ` collect ` ] ( #collect )
@@ -86,6 +87,18 @@ $currentItem = 3;
86
87
$collection->after($currentItem, $collection->first()); // return 1;
87
88
```
88
89
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
+
89
102
### ` before `
90
103
91
104
Get the previous item from the collection.
You can’t perform that action at this time.
0 commit comments