Could you advise me, pls?
I have the following relations: model1 -> pivot -> model2 -> pivot ->model3.
They have belongsToMany relations between neighbor models. But what if I want to have a relationship between Model1 and Model3? Something like belongsToManyThroug for my case. We don't have such a relationship in Laravel. Could you advise me something? Thanks!
#How to get belongsToManyThrough with two pivot tables?
3 messages · Page 1 of 1 (latest)
You can create a model for your pivot https://laravel.com/docs/9.x/eloquent-relationships#defining-custom-intermediate-table-models
Thanks! I'll try to do it.