samedi 6 octobre 2018

Laravel Relationships Between Table Values

This is a rookie question, I know. But I am building an app for my dissertation where I have three types of users. I have added a user role to the standard auth system, and set up middleware and routing based on the role. That all works fine.

But two of my roles are Supervisors (bosses) and DirectReports (employees). I need to tell the app that one supervisor has many employees, and each employee has one supervisor. I wouldn't have any issues with this if I had set up Supervisors and Employees as objects, but right now they're just values entered into a table. Maybe I should have set up a Supervisors table and a Directreports table. I'm just not sure. I'm obviously a hobbiest programmer, and trying to do this for a school project. So I apologize for asking such a basic question.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire