From the course: Building a Website with Laravel, React.js, and Inertia

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Creating the Home and About pages

Creating the Home and About pages

- [Instructor] If you remember in our React front end, we had two pages home and about. The homepage is paid all the blog posts and the about page had a short about text. Let's do the same in our Inertia app. Let's go back to web.php file. To render a simple page that doesn't need a controller, we will use what Inertia calls a shorthand route. What's happening here is that the first argument to the inertia function is the URL and the second argument is the name of the component to be rendered. It's very similar to using route view to render a blade view. We will render the About component that's going to be inside resources JS pages directory. We don't need to specify the full part to the component because here in the app.jsx file, we are telling inertia to resolve components inside the pages directory. Finally, we give the route a name. Now let's create about component in the resources, just pages directory. We can copy paste what we had in our React app. Now let's go to the About…

Contents