diff --git a/src/Illuminate/Pagination/LengthAwarePaginator.php b/src/Illuminate/Pagination/LengthAwarePaginator.php index ae7525bf3bed..e0cd317aeeb2 100644 --- a/src/Illuminate/Pagination/LengthAwarePaginator.php +++ b/src/Illuminate/Pagination/LengthAwarePaginator.php @@ -161,16 +161,16 @@ public function lastPage() public function toArray() { return [ - 'total' => $this->total(), - 'per_page' => $this->perPage(), 'current_page' => $this->currentPage(), + 'data' => $this->items->toArray(), + 'from' => $this->firstItem(), 'last_page' => $this->lastPage(), 'next_page_url' => $this->nextPageUrl(), + 'path' => $this->path, + 'per_page' => $this->perPage(), 'prev_page_url' => $this->previousPageUrl(), - 'from' => $this->firstItem(), 'to' => $this->lastItem(), - 'data' => $this->items->toArray(), - 'path' => $this->path, + 'total' => $this->total(), ]; } diff --git a/src/Illuminate/Pagination/Paginator.php b/src/Illuminate/Pagination/Paginator.php index 1ae8b1879b02..61f33e928b34 100644 --- a/src/Illuminate/Pagination/Paginator.php +++ b/src/Illuminate/Pagination/Paginator.php @@ -142,14 +142,14 @@ public function hasMorePages() public function toArray() { return [ - 'per_page' => $this->perPage(), 'current_page' => $this->currentPage(), + 'data' => $this->items->toArray(), + 'from' => $this->firstItem(), 'next_page_url' => $this->nextPageUrl(), + 'path' => $this->path, + 'per_page' => $this->perPage(), 'prev_page_url' => $this->previousPageUrl(), - 'from' => $this->firstItem(), 'to' => $this->lastItem(), - 'data' => $this->items->toArray(), - 'path' => $this->path, ]; }