In this episode, we're building out the appointment confirmation page that users see right after they've booked. We start by setting up a new view for the confirmation and making sure it gets passed the full appointment model — thanks to route model binding, that's easy! This means we have access to all the important details, like the service they've booked, who their appointment is with, and the date and time.
The first thing we do is just dump the data out on the page to check everything's working as expected. Once that's confirmed, we start borrowing some layout and info from the checkout page to make things look nice and familiar. We change the title to something like “Thanks, you’re booked in”, and make sure we’re displaying all the right info: the service name and price, the employee (with profile photo!), and of course the date and time.
For the time, we format it to be clear for the user, and we also talk about possible improvements—like storing the price directly on the appointment in case the price of the service changes later. We also realize it's a good idea to display the duration of the appointment (in minutes), and even update the checkout page with that info.
Finally, we add a spot for users to "Cancel Booking"—although the actual cancel feature will be built in the next episode. For now, it's just a link, ready for more functionality later. And as always, you can tweak the look and feel of this page as much as you want!
That’s it for the confirmation page! Next up, we’ll dive into making bookings cancellable.