Make sure to actually update other references as well

This commit is contained in:
Matthew Penner 2022-12-14 19:15:19 -07:00
parent 8fff0846a0
commit 10b2380e9e
No known key found for this signature in database

View file

@ -34,7 +34,7 @@ class Fractal extends SpatieFractal
// itself and set it automatically. // itself and set it automatically.
$class = is_string($this->transformer) ? new $this->transformer() : $this->transformer; $class = is_string($this->transformer) ? new $this->transformer() : $this->transformer;
if (is_null($this->resourceName) && $class instanceof Transformer) { if (is_null($this->resourceName) && $class instanceof Transformer) {
$this->resourceName = $this->transformer->getResourceName(); $this->resourceName = $class->getResourceName();
} }
return parent::createData(); return parent::createData();