Skip to content

secretforceagent/errorloop-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ErrorLoop Laravel SDK

Latest Version

Report production exceptions from your Laravel applications to an ErrorLoop server.

Requirements

  • PHP 8.3+
  • Laravel 11, 12, or 13

Installation

composer require errorloop/laravel-sdk

Configuration

Publish 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=true

The 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.

Usage

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);
    }
}

Disable reporting

Set ERRORLOOP_ENABLED=false in your environment to disable reporting without removing the package.

License

MIT

About

Laravel SDK for reporting exceptions to ErrorLoop

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages