src/Fractal.php
public function createData()
    {
        if (is_null($this->transformer)) {
            throw new NoTransformerSpecified();
        }

        if (is_string($this->serializer)) {
            $this->serializer = new $this->serializer;
        }

        if (! is_null($this->serializer)) {
            $this->manager->setSerializer($this->serializer);
        }

        $this->manager->setRecursionLimit($this->recursionLimit);

        if (! empty($this->includes)) {
            $this->manager->parseIncludes($this->includes);
        }

        if (! empty($this->excludes)) {
            $this->manager->parseExcludes($this->excludes);
        }

        if (! empty($this->fieldsets)) {
            $this->manager->parseFieldsets($this->fieldsets);
        }

        return $this->manager->createData($this->getResource(), $this->resourceName);
    }
public function createData()
    {
        if (is_null($this->transformer)) {
            throw new NoTransformerSpecified();
        }

        if (is_string($this->serializer)) {
            $this->serializer = new $this->serializer;
        }

        if (! is_null($this->serializer)) {
            $this->manager->setSerializer($this->serializer);
        }

        $this->manager->setRecursionLimit($this->recursionLimit);

        if (! empty($this->includes)) {
            $this->manager->parseIncludes($this->includes);
        }

        if (! empty($this->excludes)) {
            $this->manager->parseExcludes($this->excludes);
        }

        if (! empty($this->fieldsets)) {
            $this->manager->parseFieldsets($this->fieldsets);
        }

        return $this->manager->createData($this->getResource(), $this->resourceName);
    }
public function createData ( ) { if ( is_null ( $ this -> transformer ) ) { throw new NoTransformerSpecified ( ) ; } if ( is_string ( $ this -> serializer ) ) { $ this -> serializer = new $ this -> serializer ; } if ( ! is_null ( $ this -> serializer ) ) { $ this -> manager -> setSerializer ( $ this -> serializer ) ; } $ this -> manager -> setRecursionLimit ( $ this -> recursionLimit ) ; if ( ! empty ( $ this -> includes ) ) { $ this -> manager -> parseIncludes ( $ this -> includes ) ; } if ( ! empty ( $ this -> excludes ) ) { $ this -> manager -> parseExcludes ( $ this -> excludes ) ; } if ( ! empty ( $ this -> fieldsets ) ) { $ this -> manager -> parseFieldsets ( $ this -> fieldsets ) ; } return $ this -> manager -> createData ( $ this -> getResource ( ) , $ this -> resourceName ) ; }
Create fractal data.

@return \League\Fractal\Scope

@throws \Spatie\Fractalistic\Exceptions\InvalidTransformation
@throws \Spatie\Fractalistic\Exceptions\NoTransformerSpecified
Create fractal data .