From a8e6f1191bc5f809d2b3e27490d55c9be50d91c6 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 10 Jun 2021 08:46:56 -0400 Subject: [PATCH] Fix the missing links array --- .../Resources/CustomPaginatedResourceResponse.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Support/Resources/CustomPaginatedResourceResponse.php b/app/Support/Resources/CustomPaginatedResourceResponse.php index 7ddcbdf7..f9d7a450 100644 --- a/app/Support/Resources/CustomPaginatedResourceResponse.php +++ b/app/Support/Resources/CustomPaginatedResourceResponse.php @@ -14,7 +14,7 @@ class CustomPaginatedResourceResponse extends PaginatedResourceResponse protected function meta($paginated) { - return Arr::except($paginated, [ + $arr = Arr::except($paginated, [ 'data', 'first_page_url', 'last_page_url', @@ -22,5 +22,14 @@ class CustomPaginatedResourceResponse extends PaginatedResourceResponse 'next_page_url', 'links', ]); + + $arr['links'] = [ + 'first' => '', + 'last' => '', + 'next' => '', + 'prev' => ',' + ]; + + return $arr; } }