Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Bloomanity's avatar

Many to Many dilema

I have Courses, Modules and Lessons.

A course can have many modules and a module can be in many courses. A module can have many lessons and a lesson can be in many modules.

3 tables (courses, modules, lessons) 2 pivots (course_module, lesson_module) [standard]

If I'm viewing a Lessons. How can I tell from which Model and Course it is?

What's the best way handle something like this?

0 likes
0 replies

Please or to participate in this conversation.