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.
Challenge: Show a flash message - Laravel Tutorial
From the course: Building a Website with Laravel, React.js, and Inertia
Challenge: Show a flash message
(bright music) - [Instructor] We have now created a fully functional block with Laravel, Inertia, and React. Even though we covered the main functionality, there is still so much more we could do. For this challenge, I'm going to ask you to show a flash message when a post gets created, updated, and deleted. To do that, you can use Inertia's shared data. Shared data allows access to data on numerous pages. For instance, think about a username. This may be displayed on the homepage, in the site header, and other different places. Passing this in manual in each response wouldn't be a great developer experience. Another great use for shared data are flash messages as we are doing here. To handle shared data, you will first need to enable it in the HandleInertiaRequest middleware. And then you'll be able to access the data using the usePage().props object. You can read more about what to do in the Inertia documentation here.
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)
-