Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

electronick86's avatar

How to use Academic Year and Examination Session

Hello!

I'm creating a app with laravel for students. I have to store Academic Year and Examination Session.

Every academic year has 3 examination session : September, January and June. I could store every occurence in the database (It's clear for me how to do it) but it seems unnecessary to store it as it is a data 100% predictable.

An academic year is like a 'normal' year except that there is an offset of 7 months.

I could use a model with eloquent like that :

AcademicYearModel
- id (2018, 2019, 2020)
- label (2018-2019, 2019-2020, 2020-2021
- from (2018-08-01, 2019-08-01, 2020-08-01)
- until (2019-07-31, 2020-07-31, 2021-07-31)
ExaminationSessionModel
- id 
- academic_year (fk to the id of academic_years table)
- month

I need to be able to retrieve the next 3 academic years, or to get the ExaminationSessions that exists for the AcademicYear 2020.

Could you tell me how could I do that better than creating a table in the database?

Thank you!

0 likes
0 replies

Please or to participate in this conversation.