Skip to content

Pagination is inconsistent for collections #51085

Discussion options

You must be logged in to vote

Solved by writing a macro on the JsonResource class, using the defination provided by @macropay-solutions

        JsonResource::macro('paginationInformation', function ($request, $paginated, $default) {
            return array_merge(
                $paginated,
                $default['links'] ?? [],
                $default['meta'] ?? [],
            );
        });

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@macropay-solutions
Comment options

@ThePlatinum
Comment options

Comment options

You must be logged in to vote
2 replies
@macropay-solutions
Comment options

@ThePlatinum
Comment options

Answer selected by ThePlatinum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants