crashub-com/crashub-laravel
最新稳定版本:v0.3.0
Composer 安装命令:
composer require crashub-com/crashub-laravel
包简介
Crashub client for your Laravel project
README 文档
README
Use this library to start reporting exceptions to Crashub.
Install
Install the crashub-laravel package via composer:
composer require crashub-com/crashub-laravel
Add Crashub reporting to app/Exceptions/Handler.php (Laravel version 8/9):
public function register() { $this->reportable(function (\Throwable $e) { if (app()->bound('crashub')) { app('crashub')->report($e); } }); }
Run the crashub:install artisan command:
php artisan crashub:install <project key>
Your application should now report uncaught errors to Crashub.
Add context to errors
You can add custom context to the errors in the form of key/value pairs.
To add global context, use the $crashub->context() method:
$crashub->context('key', $value);
You can add multiple items:
$crashub->context([ 'key1' => $value1, 'key2' => $value2, ]);
To add context to a particular error notification, pass an associative array to $crashub->report():
$crashub->report($e, ['key' => $value]);
统计信息
- 总下载量: 495
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-12