Download the PHP package cerbero/notifiable-exception without Composer

On this page you can find all versions of the php package cerbero/notifiable-exception. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package notifiable-exception

Notifiable Exception

Latest Version on Packagist Build Status Coverage Status Quality Score Total Downloads

Laravel package to send notifications when exceptions are thrown.

Install

Via Composer

We might need to install other packages depending on the notification channels we want to use (e.g. Slack, Telegram). Please refer to Laravel Notification Channels for more information.

For better performance notifications are queued, please check the documentation to find out what are the requirements for your queue driver.

Usage

In order to be notifiable, exceptions need to implement the Notifiable interface and use the Notifies trait:

Otherwise, if we don't need to extend a particular exception class, we may just extend the NotifiableException for convenience:

When notifiable exceptions are not handled manually in a try-catch, they are notified automatically. However when we actually need to handle them we can send their notifications by calling the notify() method in the try-catch:

Sometimes we might want some channel routes to always be notified when an exception is thrown. If so, we can set default routes for every channel we want to notify in config/notifiable_exception.php:

As an example, the following configuration defines a Slack and a mail route that will always be notified when any notifiable exception is thrown:

Please note: this README shows routes in the code for convenience, however it is recommended to set routes in environment variables that can then be read from configuration files.

Different routes might need to be notified depending on what instance of notifiable exception is thrown. Ad hoc channels and routes can be defined in notifiable exceptions themselves by overriding the method getCustomRoutes():

In the example above, the phone number +1 555-666-6666 will receive an SMS whenever UrgentException is thrown, alongside with the default routes specified in the configuration.

If we want an exception to notify only its custom routes while ignoring the default ones, we can instruct the method overridesRoutes() to do so:

Messages to send can be customized per channel by overriding the method getMessages():

By default Laravel supports some notification channels (e.g. mail, slack), however custom channel classes need to be specified when using third-party solutions. We can define them by overriding the method getCustomChannels():

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of notifiable-exception with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
illuminate/support Version ^5.5|^6.0|^7.0
illuminate/contracts Version ^5.5|^6.0|^7.0
illuminate/notifications Version ^5.5|^6.0|^7.0
illuminate/bus Version ^5.5|^6.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cerbero/notifiable-exception contains the following files

Loading the files please wait ....