PHP code example of vandarpay / exception-monitoring

1. Go to this page and download the library: Download vandarpay/exception-monitoring 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/ */

    

vandarpay / exception-monitoring example snippets


use VandarPay\ExceptionMonitoring\Facades\ExceptionMonitoring;
    
    //...
    try{
        //...
        Mandate::store($data); // <--- this function will throw Exception
        //...
    } catch (Exception $exception){
        //...
        ExceptionMonitoring::set('mandate-store'); // <--- here we add important section key to redis
        //...
    }
    //...
 

ExceptionMonitoring::set('mandate-store',60); // this key will exist until 60 second.

	'token' => env('EXCEPTION_MONITORING_TOKEN')

//status code = 500
"NOK"

//status code = 200
"OK"

//status code = 401
"UNAUTHENTICATED"

use VandarPay\ExceptionMonitoring\Facades\ExceptionMonitoring;

    ExceptionMonitoring::remove('mandate-store');