protected function parseFieldset(string $key, array $fields, array $includes): array
    {
        $childIncludes = array_reduce($includes, function ($segments, $include) use ($key) {
            return array_merge($segments, $this->resolveChildIncludes($key, $include));
        }, []);

        return array_merge($fields, array_unique($childIncludes));
    }
protected function parseFieldset(string $key, array $fields, array $includes): array
    {
        $childIncludes = array_reduce($includes, function ($segments, $include) use ($key) {
            return array_merge($segments, $this->resolveChildIncludes($key, $include));
        }, []);

        return array_merge($fields, array_unique($childIncludes));
    }
protected function parseFieldset ( string $ key , array $ fields , array $ includes ) : array { $ childIncludes = array_reduce ( $ includes , function ( $ segments , $ include ) use ( $ key ) { return array_merge ( $ segments , $ this -> resolveChildIncludes ( $ key , $ include ) ) ; } , [ ] ) ; return array_merge ( $ fields , array_unique ( $ childIncludes ) ) ; }
Parse the given fieldset and append any related resource keys.

@param  string $key
@param  array  $fields
@param  array  $includes
@return array
Parse the given fieldset and append any related resource keys .