From 39fe05ba7e9bfc1dec65eaef518e0916dceb8247 Mon Sep 17 00:00:00 2001 From: mpyw Date: Sat, 2 Nov 2019 06:35:23 +0900 Subject: [PATCH] Implement Arrayable and Jsonable (#23) * Implement Arrayable and Jsonable * Add missing dependencies --- composer.json | 1 + src/PaginationResult.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8852a3b..11e782b 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "php": "^7.1", "ext-json": "*", "lampager/lampager": "^0.4", + "illuminate/contracts": "^5.6 || ^6.0 || ^7.0 || ^8.0", "illuminate/support": "^5.6 || ^6.0 || ^7.0 || ^8.0", "illuminate/database": "^5.6 || ^6.0 || ^7.0 || ^8.0" }, diff --git a/src/PaginationResult.php b/src/PaginationResult.php index caf418d..0ed9e25 100644 --- a/src/PaginationResult.php +++ b/src/PaginationResult.php @@ -2,6 +2,8 @@ namespace Lampager\Laravel; +use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Contracts\Support\Jsonable; use Illuminate\Support\Collection; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; @@ -13,7 +15,7 @@ * @see BasePaginationResult * @mixin Collection */ -class PaginationResult extends BasePaginationResult implements \JsonSerializable +class PaginationResult extends BasePaginationResult implements \JsonSerializable, Arrayable, Jsonable { use Macroable { __call as macroCall;