Report production exceptions from your Laravel applications to an ErrorLoop server.
- PHP 8.3+
- Laravel 11, 12, or 13
composer require errorloop/laravel-sdkPublish the configuration file:
php artisan vendor:publish --provider="ErrorLoop\Sdk\ErrorLoopServiceProvider"Then set your ErrorLoop project credentials in .env:
ERRORLOOP_ENDPOINT=https://er.ma.rs
ERRORLOOP_API_KEY=your-project-api-key
ERRORLOOP_ENABLED=trueThe API key is created in your ErrorLoop project and is used to authenticate exception ingestion requests.
The config file is published as config/errorloop.php.
The SDK registers an exception handler that automatically reports uncaught exceptions to ErrorLoop.
You can also report manually by resolving the reporter from the container:
use ErrorLoop\Sdk\ErrorLoopReporter;
try {
// risky code
} catch (Throwable $e) {
app(ErrorLoopReporter::class)->report($e);
}Or inject it into a controller or job:
use ErrorLoop\Sdk\ErrorLoopReporter;
public function __construct(private ErrorLoopReporter $reporter) {}
public function handle(): void
{
try {
// risky code
} catch (Throwable $e) {
$this->reporter->report($e);
}
}Set ERRORLOOP_ENABLED=false in your environment to disable reporting without removing the package.
MIT