Laravel exception- Notify – Support multiple channels laravel exception monitoring notification (Nailing group robot, flying book group robot, Server spread, enterprise wechat group robot, information).

function

  • Description Monitoring the sending of Laravel applications is abnormal
  • Support a variety of channels (nail group robot, flying book group robot, Server sauce, enterprise wechat group robot, information)
  • User-defined abnormal information data sent

The source code

  • Github.com/guanguans/l…

Related projects

  • Github.com/guanguans/n…
  • Github.com/guanguans/y…

Environmental requirements

  • Laravel > = 5.5

The installation

$ composer require guanguans/laravel-exception-notify -vvv
Copy the code

configuration

Publishing service

$ php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider"
Copy the code

Apply for channel token information

  • Nail swarm robot
  • Flying book swarm robot
  • Server sauce
  • Enterprise wechat group robot
  • Interest to know

The token information is configured in the configuration file

config/exception-notify.php

use

Modify theapp/Exceptions/Handler.phpIn the filereportmethods

public function report(Exception $exception)
{
    // Add the code
    $this->shouldReport($exception) and \ExceptionNotifier::report($exception);
    / / / / or
    // $this->shouldReport($exception) and app('exception.notifier')->report($exception);
    / / / / or
    // $this->shouldReport($exception) and \Guanguans\LaravelExceptionNotify\Facades\Notifier::report($exception);

    parent::report($exception);
}
Copy the code

Notice the results