You should probably highlight a few table columns with backticks so we can scan over them and think about it properly. Right now it just looks like a wall of text.
Like so: teacher_id
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all
So I'm pretty confident that I'm coding something in the correct way, but would appreciate any feedback in case there's a better way of doing things.
I'm currently making a system where a user can book lessons. There are many types of lessons and these can repeat over a given period. For example a lesson might be on a Tuesday and a Friday every week for six weeks.
My structure is as follows:
So the idea is that a Lesson acts kind of like a category. The user then provides the desired Session and based on the form they submit, my Controller will eventually use Carbon to loop over the dates and create entries in the session_dates table which has the session_id and the date.
So essentially I'm using logic to create a separate DB entry for each session in the given time period. Session can then access the SessionDates, and Lesson can access all of its sessions.
The Session contains the lesson_id and teacher_id.
The Student is assigned to a lesson and a session.
Does that make sense, and is there a better way of doing this or does my method make sense?
Thanks!
Please or to participate in this conversation.