Hi!
I'm hoping someone can help. I'm interested in designing my app against Laravel norm (maybe even best practice), perhaps there is something out there I don't know about to achieve this design.
I'd like to use eloquent and standard model relations as much as possible, but I'd like to split a model so it saves and reads from dynamic prefixed tables based on the model's parent relationship.
For instance - two models, Courses (metadata about the course) and Class (list of students in each class). I'm envisioning the Class model will actually save to tables in the database like class_math_101, class_hist_102, etc.
I realize I could achieve the same result in a classic one to many relationship with courses.id => classes.course_id, but for my app's reporting requirement I'm wondering if splitting it up into different tables (similar to a WordPress multisite database structure) might be beneficial.
I know you can overwrite the model's table property but I'm not sure how to do so dynamically. Any clues would be appreciated! Thanks.