Treat like an admin versus user where the teacher can see more but the student can see only his or hers. Should be able to do something there with guard.
How do I connect the users table with students and teachers table so I can get data based on the account type?
Hey y'all, I have a question for you!
I am working on a personal project (Student Information System) for a university and I am planning how the access for the users of the application will work. I would like to be able to connect the users table with either students (if the user is a student) or teacher (if the user is a teacher).
So let's say that a student logs in the system, he/she should be able to see his grades, exam schedule his/her attendance information etc. Same goes for the teacher but the difference is that they should see all of their courses they teach and be able to grade a student, write down who attended or was absent from the class on a particular date and so on.
Currently, I am thinking that if I have a 1 to 1 polymorphic relationship between users and students and users and teachers, I won't have a problem figuring out if the logged in user is a teacher account or a student account, besides the roles specified in the system. I will be able to easily retrieve profile information (Grades about the student, courses that the teacher teach and is able to grade / write down attendance information about a specific class etc) about both types of users.
- Am I on the right path?
- Any ideas or advice?
Please or to participate in this conversation.