Laravel 4.x
Laravel 4.x is supported until version 0.8.x of the sentry/sentry-laravel
package.
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
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',
)
Configure
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',
// ...
);
Usage
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());
- Package:
- composer:sentry/sentry-laravel
- Version:
- 4.7.1
- Repository:
- https://github.com/getsentry/sentry-laravel