---
title: "Laravel 4.x"
description: "Learn about using Sentry with Laravel 4.x."
url: https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel4/
---

# Laravel 4.x | Sentry for Laravel

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](https://github.com/getsentry/sentry-laravel).

This guide is for Laravel 4.x. We also provide instructions for [the latest Laravel](https://docs.sentry.io/platforms/php/guides/laravel.md) as well as [Lumen-specific instructions](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/lumen.md).

## [Install](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel4.md#install)

Install the `sentry/sentry-laravel` package:

```shell
composer require "sentry/sentry-laravel:^0.8"
```

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

`config/app.php`

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

## [Configure](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel4.md#configure)

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

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

Add your DSN to `config/sentry.php`:

`config/sentry.php`

```php
<?php

return array(
    'dsn' => '___PUBLIC_DSN___',

    // ...
);
```

## [Usage](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel4.md#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`:

```php
$app['sentry']->setRelease(Git::sha());
```
