diff --git a/src/Models/Permission.php b/src/Models/Permission.php index ad7e756..cf8b5cf 100755 --- a/src/Models/Permission.php +++ b/src/Models/Permission.php @@ -53,9 +53,9 @@ public function refreshCache(): void * @param bool $throw * @return array */ - public function getIds(array $names, bool $throw = false): array + public static function getIds(array $names, bool $throw = false): array { - $items = $this->query() + $items = static::query() ->whereIn('name', $names) ->get(['id', 'name']); diff --git a/src/Models/Role.php b/src/Models/Role.php index 83c8906..2a6acf2 100755 --- a/src/Models/Role.php +++ b/src/Models/Role.php @@ -63,9 +63,9 @@ public function refreshCacheOnDelete(): void * @param bool $throw * @return array */ - public function getIds(array $names, bool $throw = false): array + public static function getIds(array $names, bool $throw = false): array { - $items = $this->query() + $items = static::query() ->whereIn('name', $names) ->get(['id', 'name']);