src/Services/NestableService.php
public function renderAsJson($data = false, $parent = 0)
    {
        $args = func_get_args();

        if (count($args) < 1) {
            $data = $this->renderAsArray();
        } else {
            $data = $this->renderAsArray($data);
        }

        return json_encode($data);
    }
public function renderAsJson($data = false, $parent = 0)
    {
        $args = func_get_args();

        if (count($args) < 1) {
            $data = $this->renderAsArray();
        } else {
            $data = $this->renderAsArray($data);
        }

        return json_encode($data);
    }
public function renderAsJson ( $ data = false , $ parent = 0 ) { $ args = func_get_args ( ) ; if ( count ( $ args ) < 1 ) { $ data = $ this -> renderAsArray ( ) ; } else { $ data = $ this -> renderAsArray ( $ data ) ; } return json_encode ( $ data ) ; }
Pass to json string of all data as nesting.

@param object $data   Illuminate\Support\Collection
@param int    $parent

@return Recursion|array
Pass to json string of all data as nesting .