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


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

Laravel News Partners

Laravel Jobs

Senior Full Stack PHP Developer (Laravel)
Senior Laravel Developer
Senior Full-Stack Engineer
Developers for B2B eCommerce SaaS, AWS serverless, Laravel, Vue, Python
Remote, full time EU only
ES Tech Group
Senior PHP Developer (Laravel)
The Interaction Design Foundation