serializer)) { $this->serializer = new PanelSerializer(); } // Automatically set the paginator on the response object if the // data being provided implements a paginator. if ($this->data instanceof LengthAwarePaginator) { $this->paginator = new IlluminatePaginatorAdapter($this->data); } // If the resource name is not set attempt to pull it off the transformer // itself and set it automatically. if ( empty($this->resourceName) && $this->transformer instanceof TransformerAbstract && method_exists($this->transformer, 'getResourceName') ) { $this->resourceName = $this->transformer->getResourceName(); } return parent::createData(); } }