I'm currently weighing up pros and cons on ORMs to use for a project. I have looked through the docs and it appears you can do polymorphic relations which is awesome, but is it possible to do many-to-many polymorphic relations?
Yes... it would be great to have many-to-many polymorphic support, just like Laravel's Eloquent:
https://laravel.com/docs/5.1/eloquent-relationships#many-to-many-polymorphic-relations
Hi @elliotlings @jbruni ! To deal with that I hacked belongsToMany.
pictures: function () {
return this
.belongsToMany('Picture', 'picture_mapping', 'imageable_id', 'picture_id')
.query(qb => {
qb.where('imageable_type', 'user');
});
},
Any update on this ? :)
Most helpful comment
Hi @elliotlings @jbruni ! To deal with that I hacked
belongsToMany.