public function getRelations() : array { $relations = array_unique(array_merge($this->getAvailableIncludes(), $this->relations)); return array_filter($relations, function ($relation) { return $relation !== '*'; }); }
/** * Parse a transformer class and set relations. * * @param \Flugg\Responder\Transformer|callable $transformer * @param \Illuminate\Database\ELoquent\Model $model * @return \Flugg\Responder\Transformer|callable * @throws \InvalidTransformerException */ protected function parseTransformer($transformer, Model $model) { if ($transformer instanceof Transformer) { $relations = $transformer->allRelationsAllowed() ? $this->resolveRelations($model) : $transformer->getRelations(); $transformer = $transformer->setRelations($relations); } elseif (!is_callable($transformer)) { throw new InvalidTransformerException($model); } return $transformer; }