In this episode, we're setting up the notification preferences panel in a fresh Laravel project (using Laravel Breeze with Blade templates for simplicity). We'll guide you through building out the notifications page where users will be able to see their preferences, select them, and save the changes through a form.
We start by creating a new NotificationController
with two main methods: edit
for displaying the preferences and update
for handling form submissions. We'll create a new view for the notification preferences, hook up routes, and add navigation links so the page is easy to access from the menu. To save time, we copy a ready-made template for the notification panel UI (available in the GitHub repo), and explain how this layout uses Blade loops and Flexbox to neatly organize preferences and channels with checkboxes.
By the end, you’ll see how the panel is structured and how to wire up the form so it submits via the right route back to the controller. At this point, the preferences aren’t populated with real data yet—but with the structure in place, we’re set up for the next step!