I am implementing Laravel 5.3 Notifications at the moment which is working very nice.
At the moment I am using \'email\' as a notifications channel but I want to add
On Laravel 5.7 based on @Bernard answer
User.php
Notifiable.php
HasDatabaseNotifications.php
morphMany(MultiConnectionDatabaseNotification::class, 'notifiable')->orderBy('created_at', 'desc');
}
/**
* Get the entity's read notifications.
*
* @return \Illuminate\Database\Query\Builder
*/
public function readNotifications()
{
return $this->notifications()->whereNotNull('read_at');
}
/**
* Get the entity's unread notifications.
*
* @return \Illuminate\Database\Query\Builder
*/
public function unreadNotifications()
{
return $this->notifications()->whereNull('read_at');
}
}
MultiConnectionDatabaseNotification.php