viecngay/lara-except-notify
Composer 安装命令:
composer require viecngay/lara-except-notify
包简介
Notify when app have exceptions
README 文档
README
Notify to your slack channel when your project have exceptions
Required
- laravel >= 5.4
Usage
Step 1: Required to your project Add your project via composer
composer require viecngay/lara-except-notify
Step 2: Register service provider
If you are using laravel 5.4, you have to open config/app.php and append providers
'providers' => [ ... ViecNgay\Laraexcepnotify\ServiceProvider::class, ]
If you are using laravel 5.5 or higher, skip this step. Go to step 3
Step 3: Publish vendor
php artisan vendor:publish --provider="ViecNgay\Laraexcepnotify\ServiceProvider"
Step 4: Config your channel
Open config/notification.php, you will see
<?php 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' => '' ] ];
Step 4: Add event
Open app/Exceptions/Handler.php and go to report action, change to
// use ViecNgay\Laraexcepnotify\Events\HasExceptionEvent; public function report(Exception $exception) { parent::report($exception); if ($this->shouldReport($exception)) { event(new HasExceptionEvent($exception)); } }
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-13