Errors · Guides
Say who it happened to
With the person and their account on each error, an issue says how many customers it hit, the inbox puts those first, and you can tell them when it's fixed. Errors only ever gets ids.
What is sent without code
With nothing set, an error carries the signed-in user's id as its person, and no account. A guest's error carries neither. That is enough for an issue to count the people it hit.
Name the person and the account
To add the account (a team, a company, a workspace: whatever your customers are) or to name people your own way, give the SDK a closure in AppServiceProvider:
use MyBeast\Errors\Laravel\Capture\Identity;
use MyBeast\Errors\Laravel\Facades\Errors;
// AppServiceProvider::boot()
Errors::identifyUsing(fn (): ?Identity => auth()->hasUser()
? new Identity(
subject: (string) auth()->id(),
account: (string) auth()->user()->team_id,
internal: auth()->user()->is_staff,
)
: null);- Return ids: 1 to 64 letters, digits and
. _ : -. Anything else, an e-mail say, is left off with one line in your log, and the error is still sent. - Read what is in memory, as
auth()->user()is. Never run a query here: the error being reported may be the database. - Return
nullfor a guest. A closure that throws counts asnull; it never stops the error from being sent.
Browser errors carry the same ids
Errors::clientConfig() signs. Pass it the same person and account as here: Catch browser errors.What you see
- An issue's Who it hit lists the customers it hit, signed in when it happened, by the id your app sends, the latest first. Opening it is recorded in the project's audit log.
- The inbox puts the issues that hit customers before those that only fill the count, after regressions and spikes.
- A Known issue alert tells you when a customer runs into an issue you already have, once per person per issue an hour, so you can reach out first (Get alerts).
- You can ask your app to tell them "we're on it" and "it's fixed" (Tell the people it hit).
Errors never sees a name. To open a person in your own admin from an issue, set where an id leads once for the project in Settings → Links: every product uses the same link.
Your own people
Staff, demo and test accounts aren't customers. Mark them and they are never counted as customers, never in a customer alert and never told. Their errors still open issues. There are three ways:
internal: truein theIdentity, as above, for each error.- Errors' Settings → Your own people: a person or an account by its id.
- Mark internal, beside a person in an issue's Who it hit.
A reference your customers can quote
Every error has a reference, the last eight characters of its id: 7F3A9C21. It exists in your app before the error is sent, so your error page can show it:
{{-- resources/views/errors/500.blade.php --}}
@use('MyBeast\Errors\Laravel\Facades\Errors')
<h1>Something went wrong</h1>
@if ($reference = Errors::lastReference())
<p>We've been told. If you write to us, mention reference {{ $reference }}.</p>
@endifType the reference into the inbox's search, or the search at the top of any page, and it opens that very event. In the browser, onReported hands you the same reference for a crash screen.