PHPackages                             itsmill3rtime/sentry-laravel-5-7 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. itsmill3rtime/sentry-laravel-5-7

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

itsmill3rtime/sentry-laravel-5-7
================================

Laravel integration for Sentry (https://sentry.io)

10(7y ago)08Apache-2.0PHPPHP ^5.4||^7.0

Since Apr 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/itsmill3rtime/sentry-laravel-5-7)[ Packagist](https://packagist.org/packages/itsmill3rtime/sentry-laravel-5-7)[ Docs](https://sentry.io)[ RSS](/packages/itsmill3rtime-sentry-laravel-5-7/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (23)Used By (0)

 [ ![](https://camo.githubusercontent.com/370976471962ea536bf254c85b756ea56af48b88193fe69bf4ae266fb9f56be8/68747470733a2f2f73656e7472792d6272616e642e73746f726167652e676f6f676c65617069732e636f6d2f73656e7472792d6c6f676f2d626c61636b2e706e67) ](https://sentry.io)

Sentry for Laravel
==================

[](#sentry-for-laravel)

[![Build Status](https://camo.githubusercontent.com/b84c0162b244afc5e5449f129dd8f0f01b23ca4b9ec18369a8df5035160616c0/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f67657473656e7472792f73656e7472792d6c61726176656c2e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/getsentry/sentry-laravel)[![Total Downloads](https://camo.githubusercontent.com/85d0b333eba7a3842789668b37ee9bff9ede4d688ad35ab43e1836d45ae5db36/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656e7472792f73656e7472792d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sentry/sentry-laravel)[![Downloads per month](https://camo.githubusercontent.com/ba2f50c85f8529a7bb0b1d8d1d144d98f9b646cb1992330ea1fb5edced57b6a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f73656e7472792f73656e7472792d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sentry/sentry-laravel)[![Latest stable version](https://camo.githubusercontent.com/160fc3f39cb19ecd8be3c6732e3bf7b3fbca9bc41f49a33b00fa5c2577de648b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656e7472792f73656e7472792d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sentry/sentry-laravel)[![License](https://camo.githubusercontent.com/5c11414ed48c4e7db1cf2523c23377cfe5871840331d9cdf9a571738e7c9a9ee/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73656e7472792f73656e7472792d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sentry/sentry-laravel)

Laravel integration for [Sentry](https://sentry.io/).

Laravel Version Compatibility
-----------------------------

[](#laravel-version-compatibility)

- Laravel `4.2.x` is supported until version `0.8.x` (`composer require "sentry/sentry-laravel:0.8.*"`)
- Laravel `5.x.x` is supported in the most recent version (`composer require sentry/sentry-laravel`)

Installation
------------

[](#installation)

### Laravel 5.x

[](#laravel-5x)

Install the `sentry/sentry-laravel` package:

```
$ composer require sentry/sentry-laravel
```

If you're on Laravel 5.4 or earlier, you'll need to add the following to your `config/app.php`:

```
'providers' => array(
    // ...
    Sentry\SentryLaravel\SentryLaravelServiceProvider::class,
)

'aliases' => array(
    // ...
    'Sentry' => Sentry\SentryLaravel\SentryFacade::class,
)
```

Add Sentry reporting to `app/Exceptions/Handler.php`:

```
public function report(Exception $exception)
{
    if (app()->bound('sentry') && $this->shouldReport($exception)) {
        app('sentry')->captureException($exception);
    }

    parent::report($exception);
}
```

Create the Sentry configuration file (`config/sentry.php`):

```
$ php artisan vendor:publish --provider="Sentry\SentryLaravel\SentryLaravelServiceProvider"
```

Add your DSN to `.env`:

```
SENTRY_LARAVEL_DSN=https://public:secret@sentry.example.com/1

```

*Note:* If you use `SENTRY_DSN` in your `.env` it will overwrite the DSN value set in the `config/sentry.php` file.

### Laravel 4.x

[](#laravel-4x)

Install the `sentry/sentry-laravel` package on version `0.8.*` since it's the last version to support Laravel 4:

```
$ composer require "sentry/sentry-laravel:0.8.*"
```

Add the Sentry service provider and facade in `config/app.php`:

```
'providers' => array(
    // ...
    'Sentry\SentryLaravel\SentryLaravelServiceProvider',
)

'aliases' => array(
    // ...
    'Sentry' => 'Sentry\SentryLaravel\SentryFacade',
)
```

Create the Sentry configuration file (`config/sentry.php`):

```
$ php artisan config:publish sentry/sentry-laravel
```

### Lumen 5.x

[](#lumen-5x)

Install the `sentry/sentry-laravel` package:

```
$ composer require sentry/sentry-laravel
```

Register Sentry in `bootstrap/app.php`:

```
$app->register('Sentry\SentryLaravel\SentryLumenServiceProvider');

# Sentry must be registered before routes are included
require __DIR__ . '/../app/Http/routes.php';
```

Add Sentry reporting to `app/Exceptions/Handler.php`:

```
public function report(Exception $e)
{
    if (app()->bound('sentry') && $this->shouldReport($e)) {
        app('sentry')->captureException($e);
    }

    parent::report($e);
}
```

Create the Sentry configuration file (`config/sentry.php`):

```
