Skip to content

[12.x] Add "Copy as Markdown" button to error page #56657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 14, 2025

Conversation

mpociot
Copy link
Contributor

@mpociot mpociot commented Aug 14, 2025

With Laravel Boost now being released, I thought it would be cool to also give the Laravel exception page a "boost".
This PR introduces a new "Copy as Markdown" button on the default exception view.

CleanShot 2025-08-14 at 12 21 04@2x

When clicking this button, we copy a markdown representation of the exception to the users clipboard, which can then be used for AI agents/LLMs.

The markdown contains all the information that is also visible on the page:

Exception title, class, message
PHP and Laravel Version
Request and route context
Application context

As these exceptions also happen in non-secure (http://) environments, like within Herd, I used the "old-school" way of copying the content to the clipboard, as navigator.clipboard requires HTTPS and would therefore fail locally.

@taylorotwell taylorotwell merged commit 4698035 into laravel:12.x Aug 14, 2025
60 checks passed
@taylorotwell
Copy link
Member

Thanks!

@mreduar
Copy link

mreduar commented Aug 20, 2025

@freekmurze I've been waiting for this feature in Flare for a long time. It would be great to have it.

@mreduar
Copy link

mreduar commented Aug 20, 2025

It would be great to have this in Nightwatch as well, @taylorotwell 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants