private function buildQuery($table, $attributes = [])
    {
        if (class_exists($table)) {
            $query = $this->getQueryBuilderFromModel($table);
        } else {
            $query = $this->getQueryBuilderFromTable($table);
        }

        foreach ($attributes as $key => $value) {
            if (\is_array($value)) {
                call_user_func_array(array($query, "where"), $value);
            } elseif (is_null($value)) {
                $query->whereNull($key);
            } else {
                $query->where($key, $value);
            }
        }
        return $query;
    }
private function buildQuery($table, $attributes = [])
    {
        if (class_exists($table)) {
            $query = $this->getQueryBuilderFromModel($table);
        } else {
            $query = $this->getQueryBuilderFromTable($table);
        }

        foreach ($attributes as $key => $value) {
            if (\is_array($value)) {
                call_user_func_array(array($query, "where"), $value);
            } elseif (is_null($value)) {
                $query->whereNull($key);
            } else {
                $query->where($key, $value);
            }
        }
        return $query;
    }
private function buildQuery ( $ table , $ attributes = [ ] ) { if ( class_exists ( $ table ) ) { $ query = $ this -> getQueryBuilderFromModel ( $ table ) ; } else { $ query = $ this -> getQueryBuilderFromTable ( $ table ) ; } foreach ( $ attributes as $ key => $ value ) { if ( \ is_array ( $ value ) ) { call_user_func_array ( array ( $ query , "where" ) , $ value ) ; } elseif ( is_null ( $ value ) ) { $ query -> whereNull ( $ key ) ; } else { $ query -> where ( $ key , $ value ) ; } } return $ query ; }
Build Eloquent query with attributes

@param string $table
@param array $attributes
@return EloquentModel
@part orm
Build Eloquent query with attributes