Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit 40ae1e3

Browse files
author
Artem Brezhnev
committed
Fix issue #22
1 parent c847198 commit 40ae1e3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Repositories/TenantRepository.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ public function all(bool $withTrashed = true)
5151
*/
5252
public function findByAnyIdentifier($key, bool $withTrashed = true)
5353
{
54-
return $this->query($withTrashed)
55-
->where('id', $key)
56-
->orWhere('key', $key)
54+
$query = $this->query($withTrashed);
55+
56+
if (is_int($key)) {
57+
return $query->where('id', $key)->get();
58+
}
59+
60+
return $query->where('key', $key)
5761
->orWhere('uuid', $key)
5862
->get();
5963
}

0 commit comments

Comments
 (0)