From 2e436e1facd9447752f387d86d00632805a9c169 Mon Sep 17 00:00:00 2001 From: adrianzofcin Date: Wed, 18 Jan 2023 14:03:17 +0100 Subject: [PATCH] ApiResponse.php changed collection parameter type from mixed to LengthAwarePaginator --- src/Helpers/ApiResponse.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Helpers/ApiResponse.php b/src/Helpers/ApiResponse.php index 932dfbe..5923069 100644 --- a/src/Helpers/ApiResponse.php +++ b/src/Helpers/ApiResponse.php @@ -2,6 +2,8 @@ namespace Wame\ApiResponse\Helpers; +use Illuminate\Pagination\LengthAwarePaginator; + class ApiResponse { /** @@ -72,11 +74,11 @@ public static function errors(mixed $errors): static /** * Response Data with Pagination * - * @param mixed $pagination + * @param LengthAwarePaginator $pagination * @param null $resource * @return static */ - public static function collection(mixed $pagination, $resource = null): static + public static function collection(LengthAwarePaginator $pagination, $resource = null): static { if ($resource) static::$data = (array)($resource::collection($pagination))->toResponse(app('request'))->getData(); else static::$data = $pagination->toArray();