Skip to content

Commit 6616c4a

Browse files
committed
Merge pull request laravel#8255 from JosephSilber/forpage-slice
[5.0] Use the slice method
2 parents 71a4958 + c72dc3a commit 6616c4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Illuminate/Support/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public function merge($items)
408408
*/
409409
public function forPage($page, $perPage)
410410
{
411-
return new static(array_slice($this->items, ($page - 1) * $perPage, $perPage));
411+
return $this->slice(($page - 1) * $perPage, $perPage);
412412
}
413413

414414
/**

0 commit comments

Comments
 (0)