PHPackages                             rsands2801/sentry-laravel - 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. rsands2801/sentry-laravel

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

rsands2801/sentry-laravel
=========================

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

0.6.1(9y ago)06Apache-2.0PHPPHP &gt;=5.2.4

Since Apr 27Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (13)Used By (0)

sentry-laravel
==============

[](#sentry-laravel)

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

Laravel 5.x
-----------

[](#laravel-5x)

Install the `sentry/sentry-laravel` package:

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

Add the Sentry service provider and facade in `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 ($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_DSN=https://public:secret@sentry.example.com/1

```

Laravel 4.x
-----------

[](#laravel-4x)

Install the `sentry/sentry-laravel` package:

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

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 ($this->shouldReport($e)) {
        app('sentry')->captureException($e);
    }
    parent::report($e);
}
```

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

```
