protected function replaceAliases(Builder $query, $aliases)
    {
        foreach ($query->getQuery()->wheres as $key => $value) {
            if (in_array($value['column'], array_keys($aliases))) {
                $query->getQuery()->wheres[$key]['column'] = $aliases[$value['column']];
            }
        }
    }