@@ -31,7 +31,7 @@ protected function paginationInformation($request)
3131 'next ' => $ paginator ->nextPageUrl (),
3232 'previous ' => $ paginator ->previousPageUrl (),
3333 ],
34- 'meta ' => $ this ->meta ($ paginated ),
34+ 'meta ' => Arr:: get ( $ this ->meta ($ paginated), ' meta ' ),
3535 ];
3636
3737 if (method_exists ($ this ->resource , 'paginationInformation ' )) {
@@ -47,25 +47,28 @@ protected function getCustomPaginatorLinks(LengthAwarePaginator $paginator): Col
4747 $ window = UrlWindow::make ($ paginator );
4848
4949 $ isLongPagination = is_array ($ window ['slider ' ]);
50+ $ windowTruncated = $ window ;
5051
5152 // First limit the items
52- $ windowTruncated = collect ($ window )
53- ->map (function ($ item , $ key ) use ($ isLongPagination ) {
54- if ($ key == 'first ' ) {
55- return collect ($ item )->slice (0 , $ isLongPagination ? $ this ->leftSideMaximumPagesOnLong : $ this ->leftSideMaximumPages )->toArray ();
56- }
57-
58- if ($ key === 'last ' ) {
59- return collect ($ item )->slice (0 , $ isLongPagination ? $ this ->rightSideMaximumPagesOnLong : $ this ->rightSideMaximumPages )->toArray ();
60- }
61-
62- if ($ key === 'slider ' && is_array ($ item )) {
63- return collect ($ item )->slice (0 , $ isLongPagination ? $ this ->centerMaximumPagesOnLong : $ this ->centerMaximumPages )->toArray ();
64- }
65-
66- return $ item ;
67- })
68- ->toArray ();
53+ if ($ isLongPagination ){
54+ $ windowTruncated = collect ($ window )
55+ ->map (function ($ item , $ key ) use ($ isLongPagination ) {
56+ if ($ key == 'first ' ) {
57+ return collect ($ item )->slice (0 , $ isLongPagination ? $ this ->leftSideMaximumPagesOnLong : $ this ->leftSideMaximumPages )->toArray ();
58+ }
59+
60+ if ($ key === 'last ' ) {
61+ return collect ($ item )->slice (0 , $ isLongPagination ? $ this ->rightSideMaximumPagesOnLong : $ this ->rightSideMaximumPages )->toArray ();
62+ }
63+
64+ if ($ key === 'slider ' && is_array ($ item )) {
65+ return collect ($ item )->slice (0 , $ isLongPagination ? $ this ->centerMaximumPagesOnLong : $ this ->centerMaximumPages )->toArray ();
66+ }
67+
68+ return $ item ;
69+ })
70+ ->toArray ();
71+ }
6972
7073 $ elements = array_filter ([
7174 $ windowTruncated ['first ' ],
0 commit comments