composer require abenevaut/laravel-sentry-handler
php artisan sentry:publish --dsn=
In app/Exceptions/Handler.php
Replace use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
by use abenevaut\SentryHandler\Handler as ExceptionHandler;
Note: that method is used in demo
In app/Exceptions/Handler.php
Add use SentryHandlerTrait;
in App\Exceptions\Handler
class
Then adjust your report()
method
public function report(\Throwable $e): void
{
// Report standard exceptions to sentry
$this->reportSentry($e);
parent::report($e);
}
php artisan sentry:test