Skip to content

Commit

Permalink
Merge pull request #2 from boz14676/master
Browse files Browse the repository at this point in the history
Add findByWhere function.
  • Loading branch information
tlikai authored Aug 23, 2019
2 parents ed82364 + 17c6a0f commit a3a5703
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Uniqueway/Repositories/Eloquent/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ public function findBy($attribute, $value, $columns = ['*'])
{
$this->applyCriteria();

if (is_array($attribute)) {
return $this->model->where($attribute)->first($columns);
}

return $this->model->where($attribute, '=', $value)->first($columns);
}

Expand Down

0 comments on commit a3a5703

Please sign in to comment.