rickselby / laravel-exception-html
Generate HTML output for an exception
Installs: 1 429
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
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
When Symfony updated to version 5, they changed their exception handling, and this removed a very neat way of generating HTML for an exception to populate an email:
$handler = new ExceptionHandler(true); $html = $handler->getHtml($this->exception);
This is a copy of the Symfony 4 code to allow the above snippet to work again.
Additional HTML
You may pass some additional HTML heading tags to display in the main title block. This can be any additional information useful to your exception (e.g. request URL, logged in user...)
<h3 class="exception-message">{$this->request->method()} {$this->request->fullUrl()}</h3>
$handler = new ExceptionHandler(true); $html = $handler->getHtml($this->exception, $extraHeadings);