enrollment has to be a normal table, because you use enrollment_id in the learning_progress table.
learning_progress could be a pivot table.
But table name is better to have in plural form.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm trying to implement these two tables "enrollment" and "learning_progress". Look at this diagram to understand it:
I'm a bit confused because of the two foreign keys. Usually, this means it's a many to many relationship. Should I use these tables as a pivot table? Or is it still a normal eloquent model.
One thing is weird for me. How would you name these tables? The first enrollment pivot table could be courses_student table. But the second would be super weird like: course_chapter_content_courses_student...
Please or to participate in this conversation.