public function toArray(): array
    {
        $config = [
            'fields' => $this->getFields(),
        ];

        if ($this->config->has('key')) {
            $config['key'] = $this->getKey();
        } else {
            $config['key'] = Key::generate($this->getKey(), 'group');
        }

        return array_merge($this->config->toArray(), $config);
    }
public function toArray(): array
    {
        $config = [
            'fields' => $this->getFields(),
        ];

        if ($this->config->has('key')) {
            $config['key'] = $this->getKey();
        } else {
            $config['key'] = Key::generate($this->getKey(), 'group');
        }

        return array_merge($this->config->toArray(), $config);
    }
public function toArray ( ) : array { $ config = [ 'fields' => $ this -> getFields ( ) , ] ; if ( $ this -> config -> has ( 'key' ) ) { $ config [ 'key' ] = $ this -> getKey ( ) ; } else { $ config [ 'key' ] = Key :: generate ( $ this -> getKey ( ) , 'group' ) ; } return array_merge ( $ this -> config -> toArray ( ) , $ config ) ; }
Return the group as array.

@return array
Return the group as array .