Stars: 1167
Forks: 180
Pull Requests: 327
Issues: 425
Watchers: 50
Last Updated: 2023-09-05 11:20:08
The official Laravel SDK for Sentry (sentry.io)
License: MIT License
Languages: Makefile, PHP, Shell, JavaScript, Blade
Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us Check out our open positions
This is the official Laravel SDK for Sentry.
The installation steps below work on versions 8.x, 9.x and 10.x of the Laravel framework.
For older Laravel versions and Lumen see:
Install the sentry/sentry-laravel
package:
composer require sentry/sentry-laravel
Enable capturing unhandled exception to report to Sentry by making the following change to your app/Exceptions/Handler.php
:
use Sentry\Laravel\Integration;
public function register(): void
{
$this->reportable(function (Throwable $e) {
Integration::captureUnhandledException($e);
});
}
Alternatively, you can configure Sentry as a Laravel Log Channel, allowing you to capture
info
anddebug
logs as well.
Configure the Sentry DSN with this command:
php artisan sentry:publish --dsn=___PUBLIC_DSN___
It creates the config file (config/sentry.php
) and adds the DSN
to your .env
file.
SENTRY_LARAVEL_DSN=___PUBLIC_DSN___
use function Sentry\captureException;
try {
$this->functionThatMayFail();
} catch (\Throwable $exception) {
captureException($exception);
}
To learn more about how to use the SDK refer to our docs.
The Laravel and Lumen versions listed below are all currently supported:
>= 10.x.x
on PHP >= 8.1
is supported starting from 3.2.0
>= 9.x.x
on PHP >= 8.0
is supported starting from 2.11.0
>= 8.x.x
on PHP >= 7.3
is supported starting from 1.9.0
>= 7.x.x
on PHP >= 7.2
is supported starting from 1.7.0
>= 6.x.x
on PHP >= 7.2
is supported starting from 1.2.0
Please note that starting with version >= 2.0.0
we require PHP Version >= 7.2
because we are using our new PHP SDK underneath.
The Laravel versions listed below were supported in previous versions of the Sentry SDK for Laravel:
<= 4.2.x
is supported until 0.8.x
<= 5.7.x
on PHP <= 7.0
is supported until 0.11.x
>= 5.x.x
on PHP >= 7.1
is supported until 2.14.x
Please refer to CONTRIBUTING.md.
If you need help setting up or configuring the Laravel SDK (or anything else in the Sentry universe) please head over to the Sentry Community on Discord. There is a ton of great people in our Discord community ready to help you!
Licensed under the MIT license, see LICENSE
.