src/Franzose/ClosureTable/Models/Entity.php
public static function getTreeByQuery(EloquentBuilder $query, array $columns = ['*'])
    {
        /**
         * @var Entity $instance
         */
        $instance = new static;
        $columns = $instance->prepareTreeQueryColumns($columns);
        return $query->get($columns)->toTree();
    }
public static function getTreeByQuery(EloquentBuilder $query, array $columns = ['*'])
    {
        /**
         * @var Entity $instance
         */
        $instance = new static;
        $columns = $instance->prepareTreeQueryColumns($columns);
        return $query->get($columns)->toTree();
    }
public static function getTreeByQuery ( EloquentBuilder $ query , array $ columns = [ '*' ] ) { /**
         * @var Entity $instance
         */ $ instance = new static ; $ columns = $ instance -> prepareTreeQueryColumns ( $ columns ) ; return $ query -> get ( $ columns ) -> toTree ( ) ; }
Retrieves tree with any conditions using QueryBuilder
@param EloquentBuilder $query
@param array $columns
@return \Franzose\ClosureTable\Extensions\Collection
Retrieves tree with any conditions using QueryBuilder