Palzin Track
Get 15% off with code PTRACKSIGNUP15 

Laravel Diary Logo

Laravel Collection Public API: slice

The slice method in Laravel's Illuminate\Support\Collection class is used to retrieve a slice or portion of a collection. It takes an $offset parameter to determine where to start the slice. If the $offset is negative, the slice will start from the end of the collection. The slice method returns a new instance of Collection, and the original collection remains unchanged....