Akaunting/app/Exceptions/Trackers/Bugsnag.php

26 lines
500 B
PHP
Raw Normal View History

2022-10-18 22:29:40 +00:00
<?php
namespace App\Exceptions\Trackers;
use App\Traits\Trackers as Base;
2023-10-25 09:40:52 +00:00
use Akaunting\Version\Version;
2022-10-18 22:29:40 +00:00
use Throwable;
class Bugsnag
{
use Base;
2022-10-18 22:29:40 +00:00
public static function beforeSend(Throwable $e): void
{
2023-10-25 09:40:52 +00:00
app('bugsnag')->setAppVersion(Version::short());
2022-10-18 22:29:40 +00:00
2022-11-22 12:00:33 +00:00
$tags = static::getTrackerTags();
app('bugsnag')->registerCallback(function ($report) use($tags) {
2022-10-18 22:29:40 +00:00
$report->setMetaData([
'akaunting' => $tags
2022-10-18 22:29:40 +00:00
]);
});
}
}