exception-reporter / laravel-admin-ext
laravel 的异常报告器
v1.0
2021-04-13 03:04 UTC
Requires
- php: >=7.0.0
- encore/laravel-admin: ~1.5
- laravel/framework: ~6.0
Requires (Dev)
- laravel/laravel: ~6.0
- phpunit/phpunit: ~6.0
README
此工具将异常信息存储到数据库中,并提供一个面向开发者的Web界面来查看异常信息。
截图
安装
$ composer require exception-reporter/laravel-admin-ext -vvv
$ php artisan vendor:publish --tag=laravel-admin-reporter
$ php artisan migrate --path=vendor/exception-reporter/laravel-admin-ext/database/migrations
$ php artisan admin:import reporter
打开 app/Exceptions/Handler.php
,在 report
方法中调用 Reporter::report()
<?php namespace App\Exceptions; use Encore\Admin\Reporter\Reporter; use Exception; use Illuminate\Auth\AuthenticationException; use Illuminate\Validation\ValidationException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler { ... public function report(Exception $exception) { if ($this->shouldReport($exception)) { Reporter::report($exception); } // parent::report($exception); } ... }
打开 https:///admin/exceptions
来查看异常。
- laravel5.5/laravel-admin1.5 https://github.com/laravel-admin-extensions/reporter
许可证
在 MIT许可证 (MIT) 下授权。