Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Carosobin's avatar

laravel database notification

I'm about to start working with the laravel database notification using livewire to pull the notification on update

the question is I want to get different notification in one loop to display to user

example if a user like a post they get notified if they get followed they get notified if there is new comment they get notified

all in one single notification, how can I do this

0 likes
3 replies
Snapey's avatar

presume all those things happen at different times, then that would be 3 notifications. You can choose to display them how you like though.

Snapey's avatar
Snapey
Best Answer
Level 122

literally from the docs

foreach ($user->unreadNotifications as $notification) {
    echo $notification->type;
}
1 like

Please or to participate in this conversation.