In this episode, we jump right into the practical steps of creating a new page in an Inertia.js-powered Laravel application. You'll learn the full workflow—starting from setting up a new route, then building out a controller (in this case, a CommentIndexController
), and finally connecting that controller to a page component.
We talk about why it's best practice to use controllers for your routes, and we go through creating a route for /comments
that pulls in our new controller. Inside the controller, you’ll see how straightforward it is to render an Inertia page (and why the Inertia helper function is a cleaner option than importing the class method directly).
Next, we switch over to the frontend, create a new Comments/Index.vue
component, and connect it all together. There’s a bit of hands-on tweaking to get the look and feel just right, and finally, we cover how layouts work—explaining the AuthenticatedLayout
and how slots function within Laravel Breeze.
By the end of this episode, you’ll have a solid handle on how to create and render your first Inertia page, and you’ll see how this differs just a bit from the traditional Blade approach.