Linking to Flare errors on your error page
We've launched a new feature that will make it easier for users of your app to report specific errors.
When an error occurs in a web request, Laravel will show this error page by default.
If a user sees this page and wants to report this error to you, the user usually only reports the URL and the time the error was seen.
To let your users pinpoint the exact error they saw, you can display the UUID of the error sent to Flare.
If you haven't already done so, you can publish Laravel's default error pages with this command.
php artisan vendor:publish --tag=laravel-errors
Typically, you would alter the resources/views/errors/500.blade.php
to display the UUID and optionally a URL of the latest error sent to Flare.
@extends('errors::minimal')
@section('title', __('Server Error'))
@section('code', '500')
@section('message')
Server error
<div>
<a href="{{ Flare::sentReports()->latestUrl() }}">
{{ Flare::sentReports()->latestUuid() }}
</a>
</div>
@endsection
This is how that would look like in the browser.
That link returned by Flare::sentReports()->latestUrl()
isn't publicly accessible, the page is only visible to Flare users that have access to the project on Flare.
In certain cases, multiple errors can be reported to Flare in a single request. To get a hold of the UUIDs of all sent errors, you can call Flare::sentReports()->uuids()
. You can get links to all sent errors with Flare::sentReports()->urls()
.
We hope that you like this nice new feature.