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;
        });
    }
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;
        });
    }
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 ; } ) ; }
Add the allVersions extension to the builder.

@param  \Illuminate\Database\Eloquent\Builder  $builder
@return void
Add the allVersions extension to the builder .