Skip to content

Commit

Permalink
fix: lazy loading issue with permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
yajra committed Dec 5, 2024
1 parent a743287 commit d1f7222
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Traits/InteractsWithPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ public function revokeAllPermissions(): int
*/
public function getPermissions(): array
{
if (! $this->relationLoaded('permissions')) {
$this->load('permissions');
}

return $this->permissions->pluck('slug')->toArray();
}
}

0 comments on commit d1f7222

Please sign in to comment.