Skip to content

Commit a632c4b

Browse files
committed
Custom meta
1 parent 0bb2f74 commit a632c4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Controllers/RestResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,10 @@ public static function created()
657657
return (new self())->code(201);
658658
}
659659

660-
public static function index(AbstractPaginator $paginator)
660+
public static function index(AbstractPaginator $paginator, array $meta = null)
661661
{
662662
return response()->json([
663-
'meta' => RepositoryCollection::meta($paginator->toArray()),
663+
'meta' => $meta ?? RepositoryCollection::meta($paginator->toArray()),
664664
'links' => RepositoryCollection::paginationLinks($paginator->toArray()),
665665
'data' => $paginator->getCollection(),
666666
]

0 commit comments

Comments
 (0)