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

AbehoM's avatar

Scheduling (calendar) system

I'm creating a project that needs a scheduling system that would work more or less like this: I have an user (student) and also another user (teacher). I want to give the teacher the ability to choose the days and hours of the day that he is available then the user can choose one of those open hour on the calendar and take as a time for tutoring.

Any idea on how I can create that or if there's a package already?

It's more or less like Google Calendar to be honest.

0 likes
7 replies
gitwithravish's avatar
Level 16

You need to keep track of a teacher's available time . There can be any number of approaches that you can implement. Here is an example

  • create this table

teacher_available_timings

id
id_teacher
start_timestamp
end_timestamp
  • use any javascript calendar library to render the calendar on front end
  • Use the data form the above table to keep those calendar cells enabled so that the user can choose from those cells only.

But again, there is not a straight forward answer to this. Its a design level question and the approach you choose may affect many aspects of your project.

AbehoM's avatar

In your approach it doesn't take into consideration the day or any other aspect right?

gitwithravish's avatar

@zefex you can keep the datatype as timestamp. Then you can query out something like 'give me this teacher's available hours for this perticular date'. And you will get the list of records if existed.

AbehoM's avatar

@gcaraciolo Thank you for that, I will definitely read that.

@gitwithravish It makes sense, thank you.

This scheduling thing is kinda complicated tho haha.

gitwithravish's avatar

It is not actually that complicated @zefex . Once you get a good grip on working around such complexity, this will be a piece of cake for you (: Good luck !

Please or to participate in this conversation.