lattaai/latta-laravel-recorder

1.0.4 2024-10-21 20:51 UTC

This package is auto-updated.

Last update: 2025-03-21 21:51:23 UTC


README

To implement Latta into Laravel backend do:

  1. Install Latta Recorder via Composer
composer require lattaai/latta-laravel-recorder
  1. Insert API Key into ENV File
LATTA_API_KEY=xyz
  1. Add lines to bootstrap/app.php into withExceptions() function
->withExceptions(function (Exceptions $exceptions) {
    $exceptions->report(function (Throwable $e) {
        $lattaRecorder = new LattaLaravelRecorder(env('LATTA_API_KEY'));
        $lattaRecorder->reportError($e);
    });
})->create();
  1. Add lines to app/providers/AppServiceProvider.php into boot function
public function boot(): void
{
    $lattaRecorder = new LattaLaravelRecorder(env('LATTA_API_KEY'));
    $lattaRecorder->startRecording("Laravel", app()->version(), PHP_OS, "en", "server");
}