PHP code example of viecngay / lara-except-notify

1. Go to this page and download the library: Download viecngay/lara-except-notify library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

viecngay / lara-except-notify example snippets


'providers' => [
    ...
    ViecNgay\Laraexcepnotify\ServiceProvider::class,
]



return [
    'lara_exception_notify' => [
        // allow true or false
        // true is enable notify when have exception
        // false is disable notify
        'enable' => true,

        // The channel you want to nofity
        'channel' => ['slack'],

        // Your slack web hook
        // more information about slack web hook: https://api.slack.com/incoming-webhooks
        'slack_web_hook_url' => ''
    ]
];

    // use ViecNgay\Laraexcepnotify\Events\HasExceptionEvent;

    public function report(Exception $exception)
    {
        parent::report($exception);

        if ($this->shouldReport($exception)) {
            event(new HasExceptionEvent($exception));
        }
    }