diff --git a/src/Responses/RestResponse.php b/src/Responses/RestResponse.php index 53493a8..f403b69 100644 --- a/src/Responses/RestResponse.php +++ b/src/Responses/RestResponse.php @@ -2,9 +2,9 @@ namespace Ijodkor\ApiResponse\Responses; +use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Http\JsonResponse; use Illuminate\Http\Resources\Json\ResourceCollection; -use Illuminate\Pagination\LengthAwarePaginator; use Ijodkor\ApiResponse\Supporters\ListPaginator; trait RestResponse { @@ -118,9 +118,7 @@ protected function paginated($data, string $key, ?string $message = 'Muvaffaqiya return response()->json([ 'status' => true, - 'data' => [ - $key => $data - ], + 'data' => $data, 'message' => $message, ]); }