From f943cace23fb2acb042e0820c0b27d201e859522 Mon Sep 17 00:00:00 2001 From: Yury Kabanov Date: Sun, 31 Jul 2016 18:14:04 +0700 Subject: [PATCH] Fix issue with retrieving every single id to count them (fix #81) --- src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php b/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php index 99a1ea5..8127605 100644 --- a/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php +++ b/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php @@ -63,7 +63,7 @@ protected function totalAmountResourceCallable() return function () { $idKey = $this->getDataModel()->getKeyName(); - return $this->getDataModel()->query()->get([$idKey])->count(); + return $this->getDataModel()->query()->count([$idKey]); }; }