public function orderBy(string $sort, string $order = 'ASC'): self
    {
        $order = 'ASC' === strtoupper($order) ? 'ASC' : 'DESC';
        $this->orderBy = [$sort => $order];
        return $this;
    }
public function orderBy(string $sort, string $order = 'ASC'): self
    {
        $order = 'ASC' === strtoupper($order) ? 'ASC' : 'DESC';
        $this->orderBy = [$sort => $order];
        return $this;
    }
public function orderBy ( string $ sort , string $ order = 'ASC' ) : self { $ order = 'ASC' === strtoupper ( $ order ) ? 'ASC' : 'DESC' ; $ this -> orderBy = [ $ sort => $ order ] ; return $ this ; }
Specifies an ordering for the query results
Replaces any previously specified orderings, if any

@param  string $sort  Sort expression
@param  string $order Sort direction (ASC or DESC)

@return $this
Specifies an ordering for the query results Replaces any previously specified orderings if any