Skip to content

Commit

Permalink
Update BaseRepository.php
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoManiacMS authored Aug 30, 2019
1 parent f0584e3 commit e19f1a3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Prettus/Repository/Eloquent/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,20 @@ public function all($columns = ['*'])
/**
* Count results of repository
*
* @param array $where
* @param string $columns
*
* @return int
*/
public function count($columns = '*')
public function count(array $where = [], $columns = '*')
{
$this->applyCriteria();
$this->applyScope();

if($where) {
$this->applyConditions($where);
}

$result = $this->model->count($columns);

$this->resetModel();
Expand Down

0 comments on commit e19f1a3

Please sign in to comment.