Laravel
Laravel query builderインスタンスの複製
cloneを使えば良い。 $query = $this->where($cond); $query2 = clone $query; $result = $query->orderby(“hoge”, “asc”); $inverted = $query->orderby(“hoge”, “desc”);
cloneを使えば良い。 $query = $this->where($cond); $query2 = clone $query; $result = $query->orderby(“hoge”, “asc”); $inverted = $query->orderby(“hoge”, “desc”);