From 8b1dfaeb1e3a25b5ad2ec420bf77f52aff6f33d8 Mon Sep 17 00:00:00 2001 From: Daniel Stainback Date: Sat, 20 May 2017 17:50:00 -0400 Subject: [PATCH] Add missing count method --- src/Repositories/AbstractRepository.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Repositories/AbstractRepository.php b/src/Repositories/AbstractRepository.php index becc5af..c574942 100755 --- a/src/Repositories/AbstractRepository.php +++ b/src/Repositories/AbstractRepository.php @@ -349,6 +349,20 @@ public function all($columns = ['*']) return $this->query->get($columns); } + /** + * Retrieve the "count" result of the query. + * + * @param array $columns + * + * @return int + */ + public function count($columns = ['*']) + { + $this->newQuery(); + + return $this->query->count($columns); + } + /** * Get an array with the values of a given column. *