Support the ongoing development of Laravel.io →
Database Eloquent

Hello, so, i have the following problem:

https://gyazo.com/7bc0b7bb981eb7b49ebc67a4825fe8c6

I have a many to many relationship between user <-> product I have a m2m between group <-> product And i have a one to many relationship between user -> group

So, i would like to fetch all the products for the user. But take them both from group and products without having duplicates, initially i thought about a many to many through relationship, it should be, shouldn't it?

Thanks, Krzysztof.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

krzykz krzykz Joined 8 Aug 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.