In this episode, we're moving on to scaffolding the checkout flow of our app now that the core functionality is out of the way. The main goal here is to let users select a professional (or employee) and a service, setting up the initial navigation for the checkout process.
We start by generating a new Livewire component specifically for the checkout. After creating the component, we hook it up to a new route (/checkout
) that takes in the service and employee as parameters using their slugs. We also update our web routes and ensure that the links from the employee and service listings correctly take the user through to the checkout page.
To keep things moving quickly, we're using some pre-made markup from GitHub for the checkout page layout. We then bind the selected service and employee data into our checkout component using route model binding, making their details (like name, profile photo, duration, and price) available in the template.
By the end of the episode, we have a working checkout scaffold: clicking on a professional and a service leads to a populated checkout page showing their relevant details. This forms the base that we'll keep building on—next up, we'll dive into making some of these fields optional and handle more advanced flow cases!