PHP code example of eonx-com / easy-bugsnag
1. Go to this page and download the library: Download eonx-com/easy-bugsnag 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/ */
eonx-com / easy-bugsnag example snippets
// src/Exception/Handler.php
namespace App\Exception;
use Bugsnag\Client;
final class ExceptionHandler
{
/**
* @var \Bugsnag\Client
*/
private $client;
public function __construct(Client $client)
{
$this->client = $client;
}
public function report(\Throwable $throwable): void
{
// Notify Bugsnag of your throwable
$this->client->notifyException($throwable);
}
}