Download the PHP package dragon-code/notify-exceptions without Composer
On this page you can find all versions of the php package dragon-code/notify-exceptions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dragon-code/notify-exceptions
More information about dragon-code/notify-exceptions
Files in dragon-code/notify-exceptions
Package notify-exceptions
Short Description Notify the site administrator of any errors through various channels of communication.
License MIT
Informations about the package notify-exceptions
Notifex
You can use both official plugins from the Laravel team and plugins from the community.
Of course, you can also create your own.
Installation
To get the latest version of Notifex
, simply require the project using Composer:
Instead, you may of course manually update your require
block and run composer update
:
You can also publish the config file to change implementations (ie. interface to specific class):
And call php artisan migrate
command from console.
Now you can use the app('notifex')
method.
Upgrade from andrey-helldar/notify-exceptions
- Replace
"andrey-helldar/notify-exceptions": "^3.0"
with"dragon-code/notify-exceptions": "^4.0"
in thecomposer.json
file; - Replace
Helldar\Notifex
namespace prefix withDragonCode\Notifex
; - Call the
composer update
console command.
Configuration
Ingore bots
By default, the package does not respond to errors created in the process of search bots.
To enable error messages from bots, change the setting ignore_bots
in config/notifex.php file.
By default, false.
See configuration file.
Example email message:
Jira
If you need to create issues in the Jira, then you need to install the package lesstif/php-jira-rest-client:
Slack
If you need to send messages in the Slack channel, then you need to install the package laravel/slack-notification-channel:
Your notification services
You can easily connect your notification services. To do this, in block jobs
of file config/notifex.php
, add a call to its job:
If you need to pass any parameters to your job, you can use an associative entry, where the key is the link to the job class, and the values are the parameters:
Your job should inherit from the abstract class DragonCode\Notifex\Abstracts\JobAbstract
. This will help to correctly create a class for work.
To get the values of the settings you need to use the method getConfig($class, $key)
:
Examples of completed classes can be found here:
- ExampleJob
- JiraJob
It is worth noting that standard jobs of Laravel are used for the call:
They should remove the call interface ShouldQueue
and extend the class:
As the abstract class includes a call of all necessary classes and interfaces.
It's all! Enjoy 😊
Using
Add exception capturing to app/Exceptions/Handler.php
:
or just use in your code:
IMPORTANT!
To realize the possibility of saving an object to a database table, this object is processed before serialization. Due to the peculiarities of linking objects in PHP, serialization
does not support the Throwable
interface, and therefore, if you call method app('notifex')->send($exception)
before processing a variable, the application may cause an
error Expected array for frame 0
.
To avoid this, use method parent::report($exception)
strictly before sending notifications.
Test message
To verivy that Notifex is configured correctly and our integration is working, use notifex:test
command:
A DragonCode\Notifex\Exceptions\NotifexTestException
class will be thrown and captured by Notifex. The captured exception will appear in your configured email immediately.
Support
The package out of the box supports sending notifications to the following services:
- Email (default, enabled)
- Slack (default, disabled)
- Jira (default, disabled)
License
This package is licensed under the MIT License.
All versions of notify-exceptions with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/bus Version ^7.0|^8.0|^9.0
illuminate/console Version ^7.0|^8.0|^9.0
illuminate/contracts Version ^7.0|^8.0|^9.0
illuminate/notifications Version ^7.0|^8.0|^9.0
illuminate/queue Version ^7.0|^8.0|^9.0
illuminate/support Version ^7.0|^8.0|^9.0
illuminate/view Version ^7.0|^8.0|^9.0
jaybizzle/crawler-detect Version ^1.2
symfony/debug Version ^4.0
symfony/http-kernel Version ^4.0|^5.0|^6.0