Home > Blockchain >  Properly designing database structure Laravel
Properly designing database structure Laravel

Time:12-08

I would like to ask what would be your approach to this.

In short application has few roles, Admins Teachers and Students.

School year begins on specific date and it ends on one. Example 1.9.2021 till 20.6.2022. Every student has tests, and results are supposed to be managed by a teacher. By default test results are recorded 2 times a year.

Every test result is in seconds, and then you have a table with min max values for each gender and age which you can use to compare with current results.

Then later on each student has so called Archive where he can see his previous records. How can I achieve this.

Currently using Laravel 8.7 with PHP 8.0

CodePudding user response:

As you might know, in MVC (Model-View-Controller) frameworks, the model is in fact a database entity, the controller is where your application logic is located, and the view shows the data to the user.

So, for your application, I recommend the follwing structure:

Models:

  • Admin
  • Teacher
  • Student
  • Semester
  • Test
  • TestResult

Controllers:

  • AdminController
  • TeacherController
  • StudentController
  • SemesterController
  • TestController
  • TestResultController

You can decide which views are necessary.

For example:

  • students_list
  • student_info
  • test_results

Let me know if you needed more explanation

CodePudding user response:

add different models as User, School, SchoolSession, SchoolSessionTest, SchoolSessionTestQuestion, SchoolSessionTestResult relations should be pretty self-explanatory from the name of the models table with min-max values can be achieved by some group by query on your User model.

  • Related