diff --git a/src/Page.php b/src/Page.php index 1145d1f..7ea8cd6 100644 --- a/src/Page.php +++ b/src/Page.php @@ -75,14 +75,12 @@ protected function write($request) protected function writePaginatedPages($request, $paginator) { collect(range(1, $paginator->lastPage()))->each(function ($pageNumber) use ($request) { - $page = clone $this; - try { - $page + $this ->setPaginationCurrentPage($pageNumber) ->write($request); } catch (Exception $e) { - throw new NotGeneratedException($page, $e); + throw new NotGeneratedException($this, $e); } });