BitL Debug Integration - Send errors, dumps, and queries to BitL's debug bar
bitl/debug is a Laravel package for bitl debug integration - send errors, dumps, and queries to bitl's debug bar.
It currently has 0 GitHub stars and 3 downloads on Packagist (latest version v0.1.5).
Install it with composer require bitl/debug.
Discover more Laravel packages by bitl
or browse all Laravel packages to compare alternatives.
Last updated
Send PHP errors, dumps, and queries to BitL's debug bar.
composer require bitl/debug --dev
For Laravel, the service provider is auto-discovered.
use BitL\Debug\BitL;
// Send a dump to BitL
BitL::dump($user);
// Or use the helper functions
bd($user); // BitL Dump
bdd($user); // BitL Dump and Die
bitl_dump($user); // Explicit function name
try {
// ...
} catch (\Exception $e) {
BitL::error($e);
throw $e;
}
BitL::query(
sql: 'SELECT * FROM users WHERE id = ?',
bindings: [1],
time: 2.5, // milliseconds
connection: 'mysql'
);
BitL::mail(
from: '[email protected]',
to: ['[email protected]'],
subject: 'Welcome!',
html: '<h1>Hello World</h1>',
text: 'Hello World'
);
The package auto-discovers in Laravel and automatically:
For Laravel 11+, add exception reporting in bootstrap/app.php:
->withExceptions(function (Exceptions $exceptions) {
$exceptions->reportable(function (\Throwable $e) {
if (class_exists(\BitL\Debug\BitL::class)) {
\BitL\Debug\BitL::error($e);
}
return false;
});
})
For Laravel 8-10, add to app/Exceptions/Handler.php:
public function register(): void
{
$this->reportable(function (\Throwable $e) {
\BitL\Debug\BitL::error($e);
return false;
});
}
Publish the config file:
php artisan vendor:publish --tag=bitl-config
Or use environment variables:
BITL_HOST=127.0.0.1
BITL_PORT=8765
BITL_CAPTURE_ERRORS=true
BITL_CAPTURE_QUERIES=true
BITL_CAPTURE_MAIL=true
For non-Laravel PHP projects, register the error handler manually:
require 'vendor/autoload.php';
use BitL\Debug\BitL;
// Register error and exception handlers
BitL::register();
// Your code...
The Laravel integration automatically disables in non-local environments.
For manual control:
use BitL\Debug\BitL;
if (getenv('APP_ENV') === 'production') {
BitL::disable();
}
MIT