code: protected function filterEmptyGroups()
      {
          $remove = [];
          foreach ($this->permissionGroups as $key => $presence) {
              if ( ! $this->filterNestedEmptyGroups($presence)) {
                  $remove[] = $key;
              }
          }
          $this->permissionGroups->forget($remove);
  
          return $this;
      }
docs: Removes any empty (permissionless) groups from the compiled ACL structure.
  
  @return $this