Send Notifications for Exceptions with the Notifiable Exception Package

Send Notifications for Exceptions with the Notifiable Exception Package

Notifiable Exception is a Laravel package by Andrea Marco Sartori to send notifications for certain exceptions. For exceptions to be notifiable, they need to implement the package’s Notifiable interface and use the Notifies trait. Here’s an example from the project’s readme:

use Cerbero\NotifiableException\Notifiable;
use Cerbero\NotifiableException\Notifies;
use Exception;

class UrgentException extends Exception implements Notifiable
    use Notifies;

You can also extend the NotifiableException class from the package if you don’t need to extend any particular exception class.

If you don’t catch notifiable exceptions they will be notified automatically. However, you can have granular control when using a try/catch:

try {
} catch (NotifiableException $e) {
    // exception handling logic

This package is capable of other interesting things like customizing the notification channels for a specific exception class and customizing the message per channel. Check out the package’s for full details.

You can learn more about this package, get full installation instructions, and view the source code on GitHub at cerbero90/notifiable-exception.

Filed in: News / packages
Laravel News Partners

Laravel Jobs

Medior Laravel Backend Developer (The Netherlands/Dutch only)
Nijmegen, The Netherlands
BigSpark B.V.
Laravel Developer
Senior Laravel Backend Engineer
Remote, USA Only, Inc.
Full Stack Developer
Senior PHP Developer


Join 31,000+ others and never miss out on new tips, tutorials, and more.