From the course: Extending Laravel with First Party Packages
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Creating an event for new comments
From the course: Extending Laravel with First Party Packages
Creating an event for new comments
- [Instructor] Alright. We are finally to the main event. We're going to be creating an event for new comments. So every time that we create a new comment, we are going to broadcast that out to the world, and we're gonna do that through creating a Laravel event. So this is where we're actually going to handle that processing, that broadcasting out, and then we're going to also listen for the events and trigger those dom updates automatically, so all the magic is gonna kinda come together in this video. So in this video, we're going to learn how to create an event whenever a new comment is submitted, and then we're also gonna talk about how we can broadcast the event out to pusher. Okay, so let's go ahead and get started with that process. Now the first step to do here, because remember that all of our comments are working. So we've got the comment working. We can submit the comment. It saves in the database. It returns the response back to the user and everything like that. So it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Configure and install Laravel Echo10m 15s
-
(Locked)
Set up a Pusher account3m 59s
-
(Locked)
Create a blog comments system7m 53s
-
(Locked)
Create a presence channel for blog posts8m 31s
-
(Locked)
Listen to an Echo channel and upgrade room count6m 33s
-
(Locked)
Add authentication to the presence channel10m 41s
-
(Locked)
Accessing subscriber information within a presence channel9m 38s
-
(Locked)
Live updating comments8m 3s
-
(Locked)
Getting all comments11m 41s
-
(Locked)
Submit new comments9m 25s
-
(Locked)
Debugging comment submissions8m 27s
-
(Locked)
Creating an event for new comments8m 54s
-
(Locked)
Listening to the event13m 7s
-
(Locked)