In this episode, we're getting hands-on with the appointment booking form. The main focus here is to start hooking up all the key pieces of information into a form, so we can eventually send through a booking to the backend. We set up the form using Inertia's useForm
helper and make sure it can handle things like the serviceId
, employeeId
(which is sometimes missing if you don't pick a specific employee), and the all-important dateTime
slot that the user selects.
You'll see a quick demo of dumping the form's data out to the template so you can watch the values update live. It's a handy way to check everything is wired up correctly, especially as we set up how selecting a time slot updates the form's dateTime
. There's also a UX polish: whenever you click a slot, it gets visually highlighted so users know exactly which slot they've picked.
We talk about making sure the form works nicely even when the employee isn't specified, and wrap up with a preview of what's coming next: handling cases where no employee is picked and defaulting to the first available one. By the end of this episode, the core interactions for booking are all hooked up, just waiting for the user's name and email which we'll tackle in the next part!