rickselby / laravel-exception-html
为异常生成HTML输出
0.4.0
2024-03-15 07:22 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0
- symfony/error-handler: ^6.0|^7.0
Requires (Dev)
- graham-campbell/testbench: 6.*
- phpunit/phpunit: 10.*
README
当Symfony升级到版本5时,它们更改了异常处理方式,这移除了一种非常方便的生成HTML以填充邮件的异常生成方式
$handler = new ExceptionHandler(true); $html = $handler->getHtml($this->exception);
这是Symfony 4代码的副本,以便上述代码片段再次工作。
额外HTML
您可以通过传递一些额外的HTML标题标签来在主标题块中显示。这可以是关于异常的任何其他有用信息(例如请求URL、登录用户...)
<h3 class="exception-message">{$this->request->method()} {$this->request->fullUrl()}</h3>
$handler = new ExceptionHandler(true); $html = $handler->getHtml($this->exception, $extraHeadings);