PHPackages                             dbugapp/dbug-php - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. dbugapp/dbug-php

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

dbugapp/dbug-php
================

Send debug payloads from PHP to the dbug desktop app

v0.1.2(8mo ago)00MITPHPPHP &gt;=7.4

Since Apr 22Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/dbugapp/dbug-php)[ Packagist](https://packagist.org/packages/dbugapp/dbug-php)[ RSS](/packages/dbugapp-dbug-php/feed)WikiDiscussions main Synced 1mo ago

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

Dbug PHP SDK
============

[](#dbug-php-sdk)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)

Send debug payloads from PHP to the [dbug desktop app](https://github.com/dbugapp/desktop). The `Dbug` PHP SDK allows you to easily send structured debug information from your PHP application to a local server running the dbug desktop app for interactive debugging.

Features
--------

[](#features)

- Serialize complex PHP data structures to JSON with circular reference handling.
- Send payloads to a local `dbug` desktop app instance via HTTP.
- Easily configure the endpoint to customize the server URL.
- Designed for local development and debugging.

---

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

[](#installation)

You can install the `dbug-php` SDK via Composer.

```
composer require dbugapp/dbug-php --dev
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Send debug payloads by calling the `send()` method:

```
use DbugApp\Dbug;

Dbug::send([
    'event' => 'user.registered',
    'user' => [
        'id' => 123,
        'email' => 'user@example.com',
    ],
]);
```

This will serialize the payload and send it to the default dbug server at .

### Custom Endpoint

[](#custom-endpoint)

If you need to change the endpoint (e.g., for testing or different environments), you can use the `setEndpoint()` method to specify a custom URL:

```
Dbug::setEndpoint("http://127.0.0.1:54000");  // Set custom port
Dbug::send([
    'event' => 'order.completed',
    'order' => [
        'id' => 98765,
        'amount' => 49.99,
    ],
]);
```

### Laravel Log Intergration

[](#laravel-log-intergration)

If you are using Laravel, you can easily integrate the `dbug` SDK into your logging system. You can create a custom log channel in your `config/logging.php` file:

```
