PHPackages                             bugban/laravel - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. bugban/laravel

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

bugban/laravel
==============

Bugban SDK — Laravel integration: automatic exception, request, auth &amp; session capture.

v1.5.3(1mo ago)039↓69.2%MITPHPPHP &gt;=7.1

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/Umid-ismayilov/bugban-laravel)[ Packagist](https://packagist.org/packages/bugban/laravel)[ RSS](/packages/bugban-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (10)Used By (0)

Bugban SDK — Laravel
====================

[](#bugban-sdk--laravel)

Automatic exception, request, auth-user &amp; session capture for Laravel (5.5 → 12), on top of the framework-agnostic [`bugban/php-sdk`](../php-sdk) core.

Install
-------

[](#install)

```
composer require bugban/laravel
```

The service provider is auto-discovered. Optionally publish the config:

```
php artisan vendor:publish --tag=bugban-config
```

Configure — `.env`
------------------

[](#configure--env)

```
BUGBAN_API_KEY=bb_xxxxxxxx
BUGBAN_HOST=https://bugban.online
BUGBAN_CAPTURE_REQUESTS=true      # optional: per-request performance logs
BUGBAN_CAPTURE_QUERIES=true       # optional: slow-query monitoring (default: on)
BUGBAN_SLOW_QUERY_MS=1000         # optional: report queries slower than this (ms)
BUGBAN_CAPTURE_LOGS=true          # optional: forward Log::error()+ to Bugban (default: off)
BUGBAN_LOG_LEVEL=error            # optional: minimum PSR level forwarded (default: error)

```

That's it. Every exception Laravel reports is sent to Bugban together with the authenticated user, session id and request. No code changes required.

Manual capture
--------------

[](#manual-capture)

```
try {
    // ...
} catch (\Throwable $e) {
    \Bugban\Sdk\Bugban::capture($e, ['order_id' => 123]);
}
```

Log capture
-----------

[](#log-capture)

With `BUGBAN_CAPTURE_LOGS=true`, a Monolog handler is pushed onto the default log channel and forwards every record at/above `BUGBAN_LOG_LEVEL` (default `error`) to Bugban — so `Log::error('...')`, `Log::critical('...')` and *caught-and-logged* errors that never re-throw are no longer missed. File logging is unaffected (the handler bubbles). Records that carry a `Throwable` in their context are skipped, because Laravel's reported exceptions are already captured — this avoids reporting the same uncaught exception twice.

How it works
------------

[](#how-it-works)

- Hooks Laravel's `MessageLogged` event and forwards any logged exception (level `error`+).
- Resolves rich context (auth user, session, request) lazily via the core `context_resolver`.
- When `BUGBAN_CAPTURE_REQUESTS=true`, pushes request timing to `/api/ingest/requests` via a terminable middleware added to the `web` and `api` groups.
- **Slow queries**: listens to `DB::listen` on every connection (MySQL/PostgreSQL/SQLite/...); queries slower than `BUGBAN_SLOW_QUERY_MS` (default 1000 ms) are batched and sent non-blocking at shutdown to `/api/ingest/queries`, with the app caller file/line, connection name and redacted bindings.

PHP 7.1 → 8.4 compatible.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance92

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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 ~1 days

Total

9

Last Release

38d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49947736?v=4)[Umid Ismayilov](/maintainers/Umid-ismayilov)[@Umid-ismayilov](https://github.com/Umid-ismayilov)

---

Top Contributors

[![Umid-ismayilov](https://avatars.githubusercontent.com/u/49947736?v=4)](https://github.com/Umid-ismayilov "Umid-ismayilov (9 commits)")

---

Tags

laravelmonitoringerror-trackingbugban

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

89313.5M195](/packages/spatie-laravel-health)[inspector-apm/inspector-laravel

Code Execution Monitoring, built for developers.

2352.3M5](/packages/inspector-apm-inspector-laravel)[spatie/laravel-flare

Send Laravel errors to Flare

131.8M8](/packages/spatie-laravel-flare)

PHPackages © 2026

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