Skip to content

Commit

Permalink
Fix issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Brezhnev committed Sep 13, 2022
1 parent c847198 commit 40ae1e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Repositories/TenantRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ public function all(bool $withTrashed = true)
*/
public function findByAnyIdentifier($key, bool $withTrashed = true)
{
return $this->query($withTrashed)
->where('id', $key)
->orWhere('key', $key)
$query = $this->query($withTrashed);

if (is_int($key)) {
return $query->where('id', $key)->get();
}

return $query->where('key', $key)
->orWhere('uuid', $key)
->get();
}
Expand Down

0 comments on commit 40ae1e3

Please sign in to comment.