src/Transformers/Concerns/MakesResources.php
protected function shouldCacheResource($data): bool
    {
        return is_array($data) || $data instanceof Countable ? count($data) > 0 : is_null($data);
    }
protected function shouldCacheResource($data): bool
    {
        return is_array($data) || $data instanceof Countable ? count($data) > 0 : is_null($data);
    }
Indicates if the resource should be cached.

@param  mixed $data
@return bool