src/Transformers/Concerns/MakesResources.php
protected function resource($data = null, $transformer = null, string $resourceKey = null): ResourceInterface
    {
        if ($data instanceof ResourceInterface) {
            return $data;
        }

        $resourceFactory = $this->resolveContainer()->make(ResourceFactory::class);

        return $resourceFactory->make($data, $transformer, $resourceKey);
    }
protected function resource($data = null, $transformer = null, string $resourceKey = null): ResourceInterface
    {
        if ($data instanceof ResourceInterface) {
            return $data;
        }

        $resourceFactory = $this->resolveContainer()->make(ResourceFactory::class);

        return $resourceFactory->make($data, $transformer, $resourceKey);
    }
Make a resource.

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