Ignoring errors
By default, all exceptions will be reported to Flare. You can change this behaviour by filtering the exceptions with a callable:
use \Spatie\LaravelIgnition\Facades\Flare;
Flare::filterExceptionsUsing(
fn(Throwable $throwable) => !$throwable instanceof AuthorizationException
);
Additionally, you can provide a callable to the Flare::filterReportsUsing
method to stop a report from being sent to Flare. Compared to filterExceptionsCallable
, this can also prevent logs and errors from being sent.
Flare::filterReportsUsing(function(Report $report) {
// return a boolean to control whether the report should be sent to Flare
return true;
});
Finally, it is also possible to set the levels of errors reported to Flare as such:
Flare::reportErrorLevels(E_ALL & ~E_NOTICE); // Will send all errors except E_NOTICE errors