src/NestableTrait.php
protected function to()
    {
        if (static::$to === 1) {
            $method = 'renderAsArray';
        } elseif (static::$to === 2) {
            $method = 'renderAsJson';
        } elseif (static::$to === 3) {
            $method = 'renderAsHtml';
        } elseif (static::$to === 4) {
            $method = 'renderAsDropdown';
        } else {
            return $this->source;
        }

        $nest = new NestableService();
        $nest->save(static::$parameters);
        $nestable = $nest->make($this->source);

        static::$nested = false;

        return call_user_func([$nestable, $method]);
    }
protected function to()
    {
        if (static::$to === 1) {
            $method = 'renderAsArray';
        } elseif (static::$to === 2) {
            $method = 'renderAsJson';
        } elseif (static::$to === 3) {
            $method = 'renderAsHtml';
        } elseif (static::$to === 4) {
            $method = 'renderAsDropdown';
        } else {
            return $this->source;
        }

        $nest = new NestableService();
        $nest->save(static::$parameters);
        $nestable = $nest->make($this->source);

        static::$nested = false;

        return call_user_func([$nestable, $method]);
    }
protected function to ( ) { if ( static :: $ to === 1 ) { $ method = 'renderAsArray' ; } elseif ( static :: $ to === 2 ) { $ method = 'renderAsJson' ; } elseif ( static :: $ to === 3 ) { $ method = 'renderAsHtml' ; } elseif ( static :: $ to === 4 ) { $ method = 'renderAsDropdown' ; } else { return $ this -> source ; } $ nest = new NestableService ( ) ; $ nest -> save ( static :: $ parameters ) ; $ nestable = $ nest -> make ( $ this -> source ) ; static :: $ nested = false ; return call_user_func ( [ $ nestable , $ method ] ) ; }
Pass data to nest methods.

@return mixed
Pass data to nest methods .