src/NestableTrait.php
public function get()
    {
        // if exists the where or similar things in the query
        // call the from instance
        if (static::$_instance instanceof Builder) {

            $this->source = static::$_instance->get();
        } else {
            // if not call the parent directly
            $this->source = parent::all();
        }

        if (!static::$nested) {
            return $this->source;
        }

        return $this->to(static::$to);
    }
public function get()
    {
        // if exists the where or similar things in the query
        // call the from instance
        if (static::$_instance instanceof Builder) {

            $this->source = static::$_instance->get();
        } else {
            // if not call the parent directly
            $this->source = parent::all();
        }

        if (!static::$nested) {
            return $this->source;
        }

        return $this->to(static::$to);
    }
public function get ( ) { // if exists the where or similar things in the query // call the from instance if ( static :: $ _instance instanceof Builder ) { $ this -> source = static :: $ _instance -> get ( ) ; } else { // if not call the parent directly $ this -> source = parent :: all ( ) ; } if ( ! static :: $ nested ) { return $ this -> source ; } return $ this -> to ( static :: $ to ) ; }
Get the data from db to collection or default return.

@return mixed
Get the data from db to collection or default return .