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 - Laravel Tutorial
From the course: Building a Website with Laravel, React.js, and Inertia
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
-
-
-
-
-
(Locked)
Introduction to Inertia.js1m 16s
-
(Locked)
Getting started with a new Inertia project1m 58s
-
(Locked)
Creating a Post resource2m 29s
-
(Locked)
Creating the Home and About pages2m 14s
-
Creating an Inertia navigation2m 6s
-
(Locked)
Changing the website title2m 4s
-
(Locked)
Displaying posts3m 4s
-
(Locked)
Creating posts4m 37s
-
(Locked)
Displaying a single post1m 29s
-
(Locked)
Updating posts1m 51s
-
(Locked)
Deleting posts1m 33s
-
(Locked)
Challenge: Show a flash message1m 2s
-
(Locked)
Solution: Show a flash message2m 59s
-
(Locked)
-