src/Resources/ResourceFactory.php
public function make($data = null, $transformer = null, string $resourceKey = null): ResourceInterface
    {
        if ($data instanceof ResourceInterface) {
            return $this->makeFromResource($data, $transformer, $resourceKey);
        } elseif (is_null($data = $this->normalizer->normalize($data))) {
            return $this->instatiateResource($data, null, $resourceKey);
        }

        $transformer = $this->resolveTransformer($data, $transformer);
        $resourceKey = $this->resolveResourceKey($data, $resourceKey);

        return $this->instatiateResource($data, $transformer, $resourceKey);
    }
public function make($data = null, $transformer = null, string $resourceKey = null): ResourceInterface
    {
        if ($data instanceof ResourceInterface) {
            return $this->makeFromResource($data, $transformer, $resourceKey);
        } elseif (is_null($data = $this->normalizer->normalize($data))) {
            return $this->instatiateResource($data, null, $resourceKey);
        }

        $transformer = $this->resolveTransformer($data, $transformer);
        $resourceKey = $this->resolveResourceKey($data, $resourceKey);

        return $this->instatiateResource($data, $transformer, $resourceKey);
    }
Make resource from the given data.

@param  mixed                                                          $data
@param  \Flugg\Responder\Transformers\Transformer|string|callable|null $transformer
@param  string|null                                                    $resourceKey
@return \League\Fractal\Resource\ResourceInterface