protected function getFakeModelQuery($wrappedQuery)
    {
        /**
         * Clone of original Eloquent model, which we can modify to apply some hacks to build specific query
         *
         * @var Model $fakeModel
         */
        $fakeModel = new $this->model;
        $fakeModel->setTable(DB::raw("(" . $wrappedQuery->toSql() . ") AS " . $this->model->getTable()));

        /**
         * Query builder
         *
         * @var EloquentBuilder $modelQuery
         */
        $modelQuery = $fakeModel->newQueryWithoutScopes();
        $builder = Query::getBaseQuery($modelQuery);
        $builder->columns = null; // We always select everything from subquery
        $modelQuery->setQuery($builder->cloneWithoutBindings(['select', 'where'])); // remove default bindings
        $modelQuery->mergeBindings($wrappedQuery);
        return $modelQuery;
    }