src/Transformers/Concerns/HasRelationships.php
protected function mapRelations(array $relations, callable $callback): array
    {
        $mapped = [];

        foreach ($relations as $identifier => $value) {
            $mapped = array_merge($mapped, $callback($identifier, $value));
        }

        return $mapped;
    }
protected function mapRelations(array $relations, callable $callback): array
    {
        $mapped = [];

        foreach ($relations as $identifier => $value) {
            $mapped = array_merge($mapped, $callback($identifier, $value));
        }

        return $mapped;
    }
Map over a list of relations with the [identifier => constraint/transformer] structure.

@param  array    $relations
@param  callable $callback
@return array