As of right now, there's pretty limited customization for Horizon notifications, without overriding a bunch of classes. I've introduced a change that allows for a Closure to be defined in the HorizonServiceProvider, effectively allowing you to send notifications anywhere.
An example of this is LogSnag, which I use pretty heavily for monitoring and alerts on my application. This is how that would look:
class HorizonServiceProvider extends HorizonApplicationServiceProvider
{
public function boot(): void
{
...
Horizon::routeGenericNotificationsTo(function ($notification, $message) {
Logsnag::log(
channel: 'horizon',
event: 'Queue wait times alert',
description: $message,
icon: '🚨',
notify: true
);
});
}
}
I've also added some tests to verify notifications are being sent, as it seemed to not cover this.
As of right now, there's pretty limited customization for Horizon notifications, without overriding a bunch of classes. I've introduced a change that allows for a Closure to be defined in the
HorizonServiceProvider
, effectively allowing you to send notifications anywhere.An example of this is LogSnag, which I use pretty heavily for monitoring and alerts on my application. This is how that would look:
I've also added some tests to verify notifications are being sent, as it seemed to not cover this.