In this episode, we set up the functionality to list all the services offered by a specific employee. After choosing an employee, we build out a new controller called BookingEmployeeController
that handles displaying that employee's services. We also tidy up our routes and views, making sure to use nice, clean URLs with slugs and keeping things organized in appropriate folders.
Once we have our controller and route set up, we loop through the services that each employee provides and display them in a well-structured list. We add details like the service title, duration (in minutes), and the price. On top of that, we add some quick styling so everything looks tidy and user-friendly. A “Back” button is added too, to make navigation smoother.
When it comes to displaying prices, we talk about formatting money properly. Normally, we’d use the Laravel Money package, but since it doesn’t support Laravel 11 yet, we whip up a simple accessor on the Service model to format the price (handling cents and decimals), so everything still looks professional. We also briefly discuss how you’d use that package in the future for nicer formatting, once it’s available.
By the end of the episode, we have a “Choose a service” page for each employee, showing their list of services with the right details and formatting. Next up, we’ll tackle hooking into the checkout flow when someone clicks a service!