dedermus / reporter
Laravel open-admin-core的异常报告器
2.0.1
2024-09-06 12:07 UTC
Requires
- php: ^8.2
- ext-json: *
- dedermus/open-admin-core: ^v2.0
- laravel/framework: >=7.0
Requires (Dev)
- laravel/laravel: >=7.0
- phpunit/phpunit: >=6.0
This package is not auto-updated.
Last update: 2024-09-20 12:22:36 UTC
README
此工具将异常信息存储到数据库中,并为开发者提供一个友好的Web界面来查看异常信息。
屏幕截图
安装
$ composer require dedermus/reporter
$ php artisan vendor:publish --tag=open-admin-reporter
$ php artisan migrate --path=vendor/dedermus/reporter/database/migrations
$ php artisan admin:import reporter
打开bootstrap/app.php
,
- 添加:
use OpenAdminCore\Admin\Reporter\Reporter;
- 在
Application
...withExceptions
方法内部调用$exceptions->reportable(function (Throwable $e) { Reporter::report($e); });
<?php use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; use OpenAdminCore\Admin\Reporter\Reporter; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( web: __DIR__.'/../routes/web.php', commands: __DIR__.'/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { // }) ->withExceptions(function (Exceptions $exceptions) { // Add This line $exceptions->reportable(function (Throwable $e) { Reporter::report($e); }); })->create();
打开https:///admin/exceptions
来查看异常。
许可证
在MIT许可证(MIT)下许可。