PHPackages                             rcrowe/raven - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. rcrowe/raven

ActiveLibrary[Queues &amp; Workers](/categories/queues)

rcrowe/raven
============

Raven client for Sentry that supports background processing through multiple providers.

0.2.0(11y ago)3467.0k10[6 issues](https://github.com/rcrowe/Raven/issues)[3 PRs](https://github.com/rcrowe/Raven/pulls)PHP

Since Oct 31Pushed 11y ago4 watchersCompare

[ Source](https://github.com/rcrowe/Raven)[ Packagist](https://packagist.org/packages/rcrowe/raven)[ Docs](https://github.com/rcrowe/Raven)[ RSS](/packages/rcrowe-raven/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (7)Versions (3)Used By (0)

Raven
=====

[](#raven)

[![Build Status](https://camo.githubusercontent.com/b8b679fd81dade54b54379b1b51c1e2d3fef2da0da5a09ad0e8a24ea4c3413f6/68747470733a2f2f7472617669732d63692e6f72672f7263726f77652f526176656e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/rcrowe/Raven)[![Latest Stable Version](https://camo.githubusercontent.com/51d3668de8cc5bbbd3a3563065188f24fd52b723d024cdc4cbb456714978f59b/68747470733a2f2f706f7365722e707567782e6f72672f7263726f77652f526176656e2f762f737461626c652e706e67)](https://packagist.org/packages/rcrowe/Raven)[![Coverage Status](https://camo.githubusercontent.com/e191225e394ededae0c6ab8ecf014e1cab427b1ba321e7533d45ff2466a65ff9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7263726f77652f526176656e2f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/rcrowe/Raven?branch=master)[![Total Downloads](https://camo.githubusercontent.com/4a6d0b6656106bb223bde412112344e2b89a20781a700a46d68190d17c6def40/68747470733a2f2f706f7365722e707567782e6f72672f7263726f77652f726176656e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/rcrowe/raven)

Raven is a client for recording and transmitting messages to [Sentry](http://getsentry.com).

Its special sauce is that it can transmit those messages to Sentry in the background. No more slow down while a HTTP request is made!

Raven offers flexibility in how those messages are captured, processed &amp; sent. But also offers quick seemless intergration into a range of frameworks, such as:

- [Laravel](https://github.com/rcrowe/Raven#laravel)

[![Sentry](https://camo.githubusercontent.com/e111533d2a1d538e59caa9df9ac3319447ddb9f128ad393531d46b02743ab714/68747470733a2f2f7777772e67657473656e7472792e636f6d2f5f7374617469632f67657473656e7472792f696d616765732f6865726f2e706e67)](http://getsentry.com)

- [Installation](https://github.com/rcrowe/Raven#installation)
- [Usage](https://github.com/rcrowe/Raven#usage)
    - [Handlers](https://github.com/rcrowe/Raven#handlers)
        - [Sync](https://github.com/rcrowe/Raven#sync-handler)
        - [Laravel](https://github.com/rcrowe/Raven#laravel-handler)
    - [Transports](https://github.com/rcrowe/Raven#transports)
        - [Dummy](https://github.com/rcrowe/Raven#dummy)
        - [Http](https://github.com/rcrowe/Raven#http)
        - [Udp](https://github.com/rcrowe/Raven#udp)
- [Providers](https://github.com/rcrowe/Raven#providers)
    - [Laravel](https://github.com/rcrowe/Raven#laravel)

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

[](#installation)

Add `rcrowe\raven` as a requirement to composer.json:

```
{
    "require": {
        "rcrowe/raven": "~0.2.0"
    }
}
```

Update your packages with `composer update` or install with `composer install`.

Then follow the instructions for your [provider](https://github.com/rcrowe/Raven#providers) (if you are using one).

Usage
-----

[](#usage)

This library exposes the same API for recording your messages as the official raven-php client. It should just be a case of replacing `Raven_Client` with `rcrowe\Raven\Client`. For usage of recording messages checkout out [raven-php](https://github.com/getsentry/raven-php).

To record a message and transmit it to Sentry straight away (the default):

```
$raven = new \rcrowe\Raven\Client(##DSN##);

$raven->captureMessage('FooBar');
```

### Handlers

[](#handlers)

Handlers are responsible for taking a new captured message and putting into a background queue. If no handler is registered with the raven client the message is transmitted straight away.

A handler can be added to the client as follows:

```
$raven = new \rcrowe\Raven\Client(##DSN##);

$raven->setHandler(
    new \rcrowe\Raven\Handler\Sync
);
```

##### Sync Handler

[](#sync-handler)

(Default) Like [raven-php](https://github.com/getsentry/raven-php) new messages are transmitted straight away.

##### Laravel Handler

[](#laravel-handler)

If using within a Laravel project, makes use of the `illuminate\queue` API. For improved Laravel intergration checkout the [Laravel provider](#laravel) below.

```
$raven = new \rcrowe\Raven\Client(##DSN##);

$raven->setHandler(
    new \rcrowe\Raven\Handler\Laravel(
        null,
        App::make('queue')
    );
);
```

### Transports

[](#transports)

Transports are responsible for sending the message to the Sentry API. Transports are always the first parameter passed into a handler. If no transport is provided it will default to HTTP.

```
$raven->setHandler(
    new \rcrowe\Raven\Handler\Sync(
        new \rcrowe\Raven\Transport\Dummy
    )
);
```

##### Dummy

[](#dummy)

Dummy transport does absolutely nothing. Nothing is transmitted to the API. You may not want to transmit any messages when working in a dev environment.

#### HTTP

[](#http)

(Default) Transmit the message over HTTP. To do this we make use of the great HTTP client [Guzzle](http://guzzlephp.org/).

```
$raven->setHandler(
    new \rcrowe\Raven\Handler\Sync(
        new \rcrowe\Raven\Transport\Guzzle
    )
);
```

As this is the default transport mechanism there is no need to pass it into the handler. The above call is the same as:

```
$raven->addHandler(
    new \rcrowe\Raven\Handler\Sync
);
```

Providers
---------

[](#providers)

Providers offer painless integration to other libraries / frameworks.

### Laravel

[](#laravel)

#### Installation

[](#installation-1)

Add the service provider to `app/config/app.php`:

```
'rcrowe\Raven\Provider\Laravel\RavenServiceProvider',
```

Optionally register the facade to your aliases:

```
'Sentry' => 'rcrowe\Raven\Provider\Laravel\Facade\Raven',
```

#### Configuration

[](#configuration)

Raven needs to know your client DSN. First publish the Raven config file with the following command:

```
php artisan config:publish rcrowe/raven

```

Then edit `app/config/packages/rcrowe/raven/config.php`

You can also set your Raven DSN from `app/config/services.php`:

```
'raven' => [
	'dsn' => '...'
],
```

**Note:** Raven makes use of the Laravel queue, so make sure your `app/config/queue.php` is set correctly.

#### Usage

[](#usage-1)

Now where ever you want to record a message just use the normal Log facade.

```
try {
    throw new Exception('This is an example');
} catch (Exception $ex) {
    Log::error($ex);
}
```

To capture and send all messages you can add the following:

```
App::error(function(Exception $exception, $code)
{
    Log::error($exception);
});
```

**Note:** Be aware that Laravel does this out of the box in `app/start/global.php`

Using the alias you can set / remove the user information for all messages:

```
Sentry::setUser([
	'id'   => 1,
	'name' => 'Rob Crowe',
]);

Sentry::removeUser();
```

**Note:** Check out the config file for more!

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~224 days

Total

2

Last Release

4354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/07866bb8494b78f654ccdb78c6322a5651cbb8d2a85eaa210db90d833ecd0927?d=identicon)[rcrowe](/maintainers/rcrowe)

---

Top Contributors

[![jbrooksuk](https://avatars.githubusercontent.com/u/246103?v=4)](https://github.com/jbrooksuk "jbrooksuk (1 commits)")[![stayallive](https://avatars.githubusercontent.com/u/1090754?v=4)](https://github.com/stayallive "stayallive (1 commits)")

---

Tags

asynclaravelsentrybackgroundworkerraven

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/rcrowe-raven/health.svg)

```
[![Health](https://phpackages.com/badges/rcrowe-raven/health.svg)](https://phpackages.com/packages/rcrowe-raven)
```

###  Alternatives

[dusterio/laravel-aws-worker

Run Laravel (or Lumen) tasks and queue listeners inside of AWS Elastic Beanstalk workers

3105.7M](/packages/dusterio-laravel-aws-worker)[cerbero/lazy-json-pages

Framework-agnostic package to load items from any paginated JSON API into a Laravel lazy collection via async HTTP requests.

19697.4k](/packages/cerbero-lazy-json-pages)[toin0u/geotools-laravel

Geo-related tools PHP library for Laravel 4 &amp; 5

250388.0k1](/packages/toin0u-geotools-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
