elliotk
133
3
Laravel

Many to Many in Many to Many

Posted 8 months ago by elliotk

Hello,

I have a Product model, which belongs to many Categories. I also have a Discount model which belongs to many Categories.

I want to loop through a set of Products (in a basket) and calculate a discount against those where the given Discount Category is the same as the Product Category.

I don't think it's this I need https://laravel.com/docs/5.7/eloquent-relationships#has-many-through but rather some kind of IN method.

Thanks

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.