protected function apply(iterable $iterable): iterable
    {
        return Pipeline::with($iterable)
            ->mapKeys(function($_, $info) {
                $field = is_array($info) ? ($info['field'] ?? null) : $info;
                $newField = $this->map[$field] ?? ($this->dynamic ? $field : null);

                return isset($newField) && is_array($info) ? ['field' => $newField] + $info : $newField;
            })
            ->filter(function($_, $info) {
                return $info !== null;
            });
    }
protected function apply(iterable $iterable): iterable
    {
        return Pipeline::with($iterable)
            ->mapKeys(function($_, $info) {
                $field = is_array($info) ? ($info['field'] ?? null) : $info;
                $newField = $this->map[$field] ?? ($this->dynamic ? $field : null);

                return isset($newField) && is_array($info) ? ['field' => $newField] + $info : $newField;
            })
            ->filter(function($_, $info) {
                return $info !== null;
            });
    }
protected function apply ( iterable $ iterable ) : iterable { return Pipeline :: with ( $ iterable ) -> mapKeys ( function ( $ _ , $ info ) { $ field = is_array ( $ info ) ? ( $ info [ 'field' ] ?? null ) : $ info ; $ newField = $ this -> map [ $ field ] ?? ( $ this -> dynamic ? $ field : null ) ; return isset ( $ newField ) && is_array ( $ info ) ? [ 'field' => $ newField ] + $ info : $ newField ; } ) -> filter ( function ( $ _ , $ info ) { return $ info !== null ; } ) ; }
Apply mapping.

@param iterable $iterable
@return iterable
Apply mapping .