Skip to content

Commit bd9cf7d

Browse files
authored
Fix: spatie#2749 bug
1 parent 93477f5 commit bd9cf7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PermissionRegistrar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private function getSerializedRoleRelation($permission): array
349349

350350
private function getHydratedPermissionCollection(): Collection
351351
{
352-
$permissionInstance = new ($this->getPermissionClass())();
352+
$permissionInstance = (new ($this->getPermissionClass())())->newInstance([], true);
353353

354354
return Collection::make(array_map(
355355
fn ($item) => (clone $permissionInstance)
@@ -368,7 +368,7 @@ private function getHydratedRoleCollection(array $roles): Collection
368368

369369
private function hydrateRolesCache(): void
370370
{
371-
$roleInstance = new ($this->getRoleClass())();
371+
$roleInstance = (new ($this->getRoleClass())())->newInstance([], true);
372372

373373
array_map(function ($item) use ($roleInstance) {
374374
$role = (clone $roleInstance)

0 commit comments

Comments
 (0)