Adding custom context
When you send an error to Flare within a non-Laravel application, we do not collect your application information - since we don't know about your specific application. In order to provide more information, you can add custom context to your application that will be sent along with every exception that happens in your application. This can be very useful if you want to provide key-value related information that furthermore helps you to debug a possible exception.
The Flare client allows you to set custom context items like this:
// Get access to your registered Flare client instance
$flare->context('Tenant', 'My-Tenant-Identifier');
This could for example be set automatically in a Laravel service provider or an event. So the next time an exception happens, this value will be sent along to Flare and you can find it on the "Context" tab.
Grouping multiple context items
Sometimes you may want to group your context items by a key that you provide to have an easier visual differentiation when you look at your custom context items.
The Flare client allows you to also provide your own custom context groups like this:
// Get access to your registered Flare client instance
$flare->group('Custom information', [
'key' => 'value',
'another key' => 'another value',
]);