src/Transformers/Concerns/HasRelationships.php
protected function normalizeRelations(array $relations): array
    {
        return array_reduce(array_keys($relations), function ($normalized, $relation) use ($relations) {
            if (is_numeric($relation)) {
                return array_merge($normalized, [$relations[$relation] => null]);
            }

            return array_merge($normalized, [$relation => $relations[$relation]]);
        }, []);
    }
protected function normalizeRelations(array $relations): array
    {
        return array_reduce(array_keys($relations), function ($normalized, $relation) use ($relations) {
            if (is_numeric($relation)) {
                return array_merge($normalized, [$relations[$relation] => null]);
            }

            return array_merge($normalized, [$relation => $relations[$relation]]);
        }, []);
    }
Normalize relations to force an [identifier => constraint/transformer] structure.

@param  array $relations
@return array