From b6fbe53b28519ed60a7071a335a2816173c60625 Mon Sep 17 00:00:00 2001 From: Davide Bellini Date: Wed, 7 Oct 2015 15:31:49 +0200 Subject: [PATCH] Use Collection on API Paginator presenter This allows to decorate all model's attributes inside the Collection --- app/Http/Controllers/Api/AbstractApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AbstractApiController.php b/app/Http/Controllers/Api/AbstractApiController.php index 83d79b3a4..573214092 100644 --- a/app/Http/Controllers/Api/AbstractApiController.php +++ b/app/Http/Controllers/Api/AbstractApiController.php @@ -167,7 +167,7 @@ abstract class AbstractApiController extends Controller $items = $items->sortBy($sortBy, SORT_REGULAR, $direction); } - return $this->setMetaData($pagination)->setData(AutoPresenter::decorate($items->values()->all()))->respond(); + return $this->setMetaData($pagination)->setData(AutoPresenter::decorate($items->values()))->respond(); } /**