File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,7 @@ private function getHydratedPermissionCollection(): Collection
360360 $ permissionInstance = new ($ this ->getPermissionClass ())();
361361
362362 return Collection::make (array_map (
363- fn ($ item ) => $ permissionInstance -> newInstance ([], true )
363+ fn ($ item ) => ( clone $ permissionInstance )
364364 ->setRawAttributes ($ this ->aliasedArray (array_diff_key ($ item , ['r ' => 0 ])), true )
365365 ->setRelation ('roles ' , $ this ->getHydratedRoleCollection ($ item ['r ' ] ?? [])),
366366 $ this ->permissions ['permissions ' ]
@@ -379,7 +379,7 @@ private function hydrateRolesCache(): void
379379 $ roleInstance = new ($ this ->getRoleClass ())();
380380
381381 array_map (function ($ item ) use ($ roleInstance ) {
382- $ role = $ roleInstance -> newInstance ([], true )
382+ $ role = ( clone $ roleInstance )
383383 ->setRawAttributes ($ this ->aliasedArray ($ item ), true );
384384 $ this ->cachedRoles [$ role ->getKey ()] = $ role ;
385385 }, $ this ->permissions ['roles ' ]);
You can’t perform that action at this time.
0 commit comments