diff --git a/src/Support/Format.php b/src/Support/Format.php index 88a1bf9..d5f106f 100644 --- a/src/Support/Format.php +++ b/src/Support/Format.php @@ -95,10 +95,10 @@ public function paginator(AbstractPaginator|AbstractCursorPaginator|Paginator $r */ public function resourceCollection(ResourceCollection $collection): array { - return array_filter([ + return [ 'data' => $collection->resolve(), 'meta' => $this->formatMeta($collection->resource), - ]); + ]; } /** @@ -182,6 +182,7 @@ protected function formatJsonResource(): \Closure */ protected function formatMeta($collection): array { + // vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php return match (true) { $collection instanceof CursorPaginator => [ 'cursor' => [