Looking to hire Laravel developers? Try LaraJobs
This package is not available.

laravel-exception-html maintained by rickselby

Description
Generate HTML output for an exception
Author
Last update
2025/11/24 10:13 (dev-dependabot/github_actions/actions/checkout-6)
License
Links
Downloads
1 525

Comments
comments powered by Disqus

Laravel Exception HTML

Software License Packagist Version

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);