public function orderBy($column, $type = 'asc')
    {
        if (! is_null($this->order)) {
            return $this;
        }

        if (!in_array($type, ['asc', 'desc'])) {
            $type = 'asc';
        }

        $this->order = 'order by `'.$column.'` '.$type;

        return $this;
    }
public function orderBy($column, $type = 'asc')
    {
        if (! is_null($this->order)) {
            return $this;
        }

        if (!in_array($type, ['asc', 'desc'])) {
            $type = 'asc';
        }

        $this->order = 'order by `'.$column.'` '.$type;

        return $this;
    }
public function orderBy ( $ column , $ type = 'asc' ) { if ( ! is_null ( $ this -> order ) ) { return $ this ; } if ( ! in_array ( $ type , [ 'asc' , 'desc' ] ) ) { $ type = 'asc' ; } $ this -> order = 'order by `' . $ column . '` ' . $ type ; return $ this ; }
Clause Order By

@param string $column
@param string $type

@return QueryBuilder
Clause Order By