laravel collection splice

Solutions on MaxInterview for laravel collection splice by the best coders in the world

showing results for - "laravel collection splice"
Adrián
21 Nov 2017
1$collection = collect([1, 2, 3, 4, 5]);
2
3$chunk = $collection->splice(2);
4
5$chunk->all();
6
7// [3, 4, 5]
8
9$collection->all();
10
11// [1, 2]
similar questions
queries leading to this page
laravel collection splice