Hello, I'm working on a project for a school where I need to have a users table that will have staff and students. I am setting up roles and permissions for the staff to have access evaluation tools. I also need to store additional information specific to each student. What is the best way to set up my database structure to include this information?
The role of the user can be saved as a "role" column in the "users" table, I personally would choose a enum field.
The permissions are really easy to declare with Laravel, see Authorization:
$gate->define('evaluation-tools', function ($user) {
return $user->role == 'teacher';
});
Which kind of information do you have to store about the students?
Thanks @TheNodi. I like your approach to my problem. None of my users will ever have more than 1 role so saving it on the users table should work and a separate table for additional student information is good too.