PHPackages                             afterbug/afterbug - 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. afterbug/afterbug

ActiveLibrary

afterbug/afterbug
=================

AfterBug error monitoring for PHP applications.

1.0.2(7y ago)0682MITPHPPHP &gt;=5.5

Since May 10Pushed 7y ago1 watchersCompare

[ Source](https://github.com/AfterBug/afterbug-php)[ Packagist](https://packagist.org/packages/afterbug/afterbug)[ RSS](/packages/afterbug-afterbug/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (2)

AfterBug for PHP
================

[](#afterbug-for-php)

[![StyleCI](https://camo.githubusercontent.com/cb0d31c63cc5b8ec33dc170751b911362bd140b423c58bb051f24eb6dd9c1897/68747470733a2f2f7374796c6563692e696f2f7265706f732f3133313437313834382f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/66539893)[![Total Downloads](https://camo.githubusercontent.com/ed0b5732df20eeec7d7a1647e1fa45dd009fdc2f37f74d79d4dc625b137552e1/68747470733a2f2f706f7365722e707567782e6f72672f61667465726275672f61667465726275672f646f776e6c6f616473)](https://packagist.org/packages/afterbug/afterbug)[![Latest Stable Version](https://camo.githubusercontent.com/8bc701b7ce060674521ac98b717f96e73fb0499d709879171b2bc68c0dcec28b/68747470733a2f2f706f7365722e707567782e6f72672f61667465726275672f61667465726275672f762f737461626c65)](https://packagist.org/packages/afterbug/afterbug)[![Latest Unstable Version](https://camo.githubusercontent.com/39ba62d2fe37f4886d7599e3610342a5d7a123c73e8a731be20f51aa237d97da/68747470733a2f2f706f7365722e707567782e6f72672f61667465726275672f61667465726275672f762f756e737461626c65)](https://packagist.org/packages/afterbug/afterbug)[![License](https://camo.githubusercontent.com/2c0600c2600dc782b7fee8cfbc1f912c686bfea93ee809181bef6b08509c5af8/68747470733a2f2f706f7365722e707567782e6f72672f61667465726275672f61667465726275672f6c6963656e7365)](https://packagist.org/packages/afterbug/afterbug)

This library detects errors and exceptions in your PHP application and reports them to AfterBug for alerts and reporting.

Features
--------

[](#features)

- Automatically report exceptions and errors
- Send customized diagnostic data
- Attach user information to determine how many people are affected by the error.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require afterbug/afterbug "~1.0"

```

Add `afterbug/afterbug` to your composer.json

```
"afterbug/afterbug": "~1.0"

```

Usage
-----

[](#usage)

```
$afterbug = AfterBug\Client::make('AFTERBUG_API_KEY')

// Register AfterBug error handler
AfterBug\Exceptions\ErrorHandler::register($afterbug);

// will be reported by the exception handler
throw new \Exception('testing exception handler');
```

### Exclude exceptions

[](#exclude-exceptions)

Sets for which exception classes we should not send to AfterBug.

```
$afterbug->registerCallback(function ($config) {
    $config->setExcludeExceptions(['Namespace\ExceptionClass']);
});
```

### Callbacks

[](#callbacks)

Set a callback to customize the data.

```
$afterbug->registerCallback(function ($config) {
    $config->setEnvironment('Production')
        ->setUser([
            'id' => 1,
            'name' => 'Alfa'
        ])
        ->setMetaData([
            'custom' => 'Your custom data'
        ]);
});
```

Integration with frameworks
---------------------------

[](#integration-with-frameworks)

Other packages exists to integrate this SDK into the most common frameworks.

### Official Integrations

[](#official-integrations)

The following integrations are supported by AfterBug team.

- [Laravel](https://github.com/AfterBug/afterbug-laravel)
- [Yii Framework](https://github.com/AfterBug/afterbug-yii)
- Feel free to create a port to your favorite framework!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~7 days

Total

3

Last Release

2913d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef0480adb6c2494f21910eb4e69ab92b02e075bfdad37c242fed4f20d0e5412c?d=identicon)[alfa6661](/maintainers/alfa6661)

---

Top Contributors

[![alfa6661](https://avatars.githubusercontent.com/u/3650559?v=4)](https://github.com/alfa6661 "alfa6661 (13 commits)")

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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