protected function addAllVersions(Builder $builder)
    {
        $builder->macro('allVersions', function(Builder $builder) {
            $model = $builder->getModel();

            $this->remove($builder, $builder->getModel());

            $builder->join($model->getVersionTable(), function($join) use ($model) {
                $join->on($model->getQualifiedKeyName(), '=', $model->getQualifiedVersionKeyName());
            });

            return $builder;
        });
    }