You could use
- laravel calendar
- look at github booking packages get ideas from code how they did it
And look for past laracast postings on booking systems, there have been a few.
In one I did I just had available slots.
Hello, this is my first time creating a discussion here on Laracasts :)
I'm using Laravel 8 with Inertia JS and Vue 3.
I am currently developing a booking system for a client. At first the idea the client brought up, was that the employees needed the functionality to book customers appointments in the shop. The shop is a fitness/instructor business, where customers can be booked for a session for 30 minutes.
Recently the customer asked, if the possibility of creating an online booking functionality would be possible, and I immediately began designing, structuring and implement the features for this. After weeks of trying I ran into some issues.
Before really digging into the question, then let me describe whats needed for the booking system.
Let's say the store has different working hours throughout the week.
Monday: 9.00 AM - 5.00 PM
Tuseday: 9.00 AM - 5.00 PM
Wedensday: 9.00 AM - 5.00 PM
Thursday: 9.00 AM - 4.00 PM
Friday: 10.00 AM - 2.00 PM
Weekend: Closed
The user can then choose a date from a datepicker and should be presented with available time slots for that day.
The length of the session is 30 minutes, so a time slot should be with an interval of 30 minutes.
Monday is open from 9.00 AM to 5.00 PM. It needs a total of 21 available slots. When a slot is booked by a customer, then the time slot should not be visible for that exact date anymore.
I've tried the following already, which works, but seems to be a bit of work by the customer, and I wanted to make it as simple as possible, so the customer doesn't have to struggle when using the application.
As of now I am storing all possible time slots manually, and when a user books the time slot I simply just update the table row with a boolean field checking is the slot is available or not.
Is there a better way of doing this instead of storing every single time slot in the database? I've tried playing around with generating time slots for a single day without the database (which works for a single day), but I feel like I'm stuck at this point. It feels like I am filling the database with unnecessary data - for instance, if the time slot isn't being booked, then it's just sitting there.
Just the time slots alone will be 7,665 records created manually or with some help of a database seeder. But what if the customer wants to change there opening hours, does it need to seed every single records from scratch again?
If something is not clear, I'll be happy to explain further :)
Thanks in advance!
Please or to participate in this conversation.