Laravel 4.x

Laravel is supported using a native package: sentry-laravel.

This guide is for Laravel 4.x. We also provide instructions for the latest Laravel as well as Lumen-specific instructions.

Install the sentry/sentry-laravel package:

Copied
composer require "sentry/sentry-laravel:^0.8"

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

config/app.php
Copied
'providers' => array(
    // ...
    'Sentry\SentryLaravel\SentryLaravelServiceProvider',
),
'aliases' => array(
    // ...
    'Sentry' => 'Sentry\SentryLaravel\SentryFacade',
)

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

Copied
php artisan config:publish sentry/sentry-laravel

Add your DSN to config/sentry.php:

config/sentry.php
Copied
<?php

return array(
    'dsn' => 'https://examplePublicKey@o0.ingest.sentry.io/0',

    // ...
);

If you wish to wire up Sentry anywhere outside of the standard error handlers, or if you need to configure additional settings, you can access the Sentry instance through $app:

Copied
$app['sentry']->setRelease(Git::sha());
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").