kirschbaum-development / eloquent-power-joins

The Laravel magic you know, now applied to joins.
MIT License
1.39k stars 87 forks source link

Custom eloquent builder fix #178

Closed wpj16 closed 6 months ago

wpj16 commented 6 months ago

Yeah, that never was implemented. It was simple to add this feature, so I just tagged a new version, can you test it?

Originally posted by @luisdalmolin in https://github.com/kirschbaum-development/eloquent-power-joins/issues/177#issuecomment-2021289497

It worked correctly.

All that remains is to initialize (the model that was joined) and assign it to the eloquent builder ( $builder->setModel( new ModelJoin() ) )

wpj16 commented 6 months ago

image

In the image, within the builder, you can see that the getModel() method is often used, both in the custom and official builder.

So I think all that remains is to pass the instance of the model that was joined to the setModel() method of the builder.

luisdalmolin commented 6 months ago

Good point, added and tagged a new release.

wpj16 commented 6 months ago

Bom ponto, adicionado e marcado um novo lançamento.

working perfectly, thanks for the updates