Skip to content

Commit

Permalink
Merge pull request #15 from celysium/feat/get_by_id
Browse files Browse the repository at this point in the history
fix get id by role and permission
  • Loading branch information
hekmatinasser authored Jan 23, 2023
2 parents ea028ca + 20898c7 commit c36af5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down
4 changes: 2 additions & 2 deletions src/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down

0 comments on commit c36af5b

Please sign in to comment.