Playing
01. Introduction and demo

Transcript

00:00
Storing more complex notification preferences in Laravel can be pretty tricky. In this course I'm going to guide you through how to set this up, how to display these groups and individual notification preferences
00:14
within some sort of dashboard area. Then we're going to look at syncing these to the database. We'll write some tests alongside of these with PEST just to make sure everything is good and nothing breaks in the future.
00:25
And then we'll add some other finishing touches to this as well. And then I'll go ahead and show you how you can actually use these notification preferences that have been selected directly inside your notification classes. Now the good thing about this system is it is incredibly flexible.
00:43
If we wanted to add a new notification section we could very easily do that. What we could also do is add new individual notification preferences within these sections. And we can also add new channels as well. So let me just show you how to do one of these.
00:58
And you'll be able to pretty much just manage all of this stuff either directly from your database or from your admin panel. So let's add SMS here as a notification channel. And as you can see this automatically adds this for us.
01:11
And the user can then just go ahead and start to select these. They can go ahead and save these out. They will be saved. And then when we get to the notification level, which we've just had a look at, all of these channels here will be returned.
01:24
And then of course within your notifications you can go ahead and customize how you want these to be sent based on the channels that the user has selected. So very very flexible. Let's go ahead and look at how we build this from start to finish.

Episode summary

Welcome to the course! In this episode, we’re kicking things off by talking about how to handle more complex notification preferences in Laravel—believe it or not, it can get a bit tricky. I’ll show you how we can set up groups and individual notification settings, all neatly displayed in a dashboard area for your users.

We'll walk through syncing those preferences to the database so everything persists, and I’ll introduce some testing with PEST to make sure things stay solid as you build new features. Once that’s set up, I’ll sprinkle in some finishing touches to polish the experience.

After that, I’ll demo how these saved preferences can be used directly inside your Laravel notification classes. The really cool part? This system is super flexible—you can easily add new notification sections, individual preferences, or even completely new channels (like SMS), directly through the admin panel or database.

In the demo, I show adding SMS as a new notification channel and how users can immediately start using it. Their choices are saved, and when a notification is sent out, the app knows exactly which channels to use based on what the user selected.

By the end of the episode, you'll get a clear idea of how powerful and customizable this approach is to notification preferences in Laravel. Let’s dive into building everything from scratch!

Episode discussion

No comments, yet. Be the first!