Capture PHP VarDumper output and redirect it to any channel you control. Works with or without Laravel.
- Quick Start
- Requirements
- Installation
- Windows Desktop App
- Integration Guides
- Usage Examples
- Testing
- Release Process
- Contributing
- License
- Install the library:
composer require laler/laler - Install Windows desktop app (optional): Download and run
installer/lalerapp_0.1.0_x64_en-US.msias Administrator - Start debugging: Use
laler('Your debug data')in your PHP code - View results in the desktop app or console
- PHP ^8.0
- Symfony VarDumper ^6.0 || ^7.0
- PSR-11 Container Interface ^1.0 || ^2.0
Optional (for Laravel integration):
- Laravel (Illuminate components) ^9.0 || ^12.0
composer require laler/laler
composer installFor Laravel projects: The package is auto-discovered, so no manual provider registration is required.
To forward dumps to the desktop app during local development, add a TauriDumper registration inside your App\Providers\AppServiceProvider boot() method as shown below.
For plain PHP projects: Include the Composer autoloader and call the laler() helper.
For a visual interface to view your laler() dumps, install the Windows desktop application:
- Download the installer:
installer/lalerapp_0.1.0_x64_en-US.msi - Right-click → "Run as Administrator" (required for system-level HTTP server setup)
- Follow the installation wizard
- Launch the Laler app from Start Menu or Desktop shortcut
- Start the desktop app first
- Configure your laler() calls to send dumps to the app (see TauriDumper examples below)
- View dumps in real-time through the desktop interface
Note: The desktop app provides a user-friendly interface for debugging and monitoring your PHP application dumps without cluttering your console or logs.
- Boot autoloader:
require 'vendor/autoload.php'; - Get manager:
$manager = laler_manager(); - Register dumpers:
$manager->register(new TauriDumper('http://localhost:3000')); - Send values:
laler($data);
Note: In plain PHP projects, the vendor directory is typically at your project root, so use
__DIR__ . '/vendor/autoload.php'. In Laravel projects within subdirectories, you might need__DIR__ . '/../vendor/autoload.php'depending on your file location.
require __DIR__.'/vendor/autoload.php';
use DateTimeImmutable;
use Laler\Dumpers\TauriDumper;
if (! function_exists('now')) {
function now(): DateTimeImmutable
{
return new class extends DateTimeImmutable {
public function toISOString(): string
{
return $this->format(DATE_ATOM);
}
};
}
}
$manager = laler_manager();
$manager->register(new TauriDumper('http://localhost:3000'));
laler(['data' => ['nested' => 'structure']]);- Install
composer require laler/laler - Register dumpers (for example, in a service provider)
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Laler\DumpCaptureManager;
use Laler\Dumpers\TauriDumper;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
if ($this->app->environment('local')) {
$manager = $this->app->make(DumpCaptureManager::class);
$manager->register(new TauriDumper('http://localhost:3000'));
}
}
}- Use helper: call
laler()anywhere to route values through configured dumpers.
DumpCaptureManager centralises dump collection and forwards each value to your registered dumpers. Retrieve it from the container and register any DataDumperInterface implementation:
use Laler\DumpCaptureManager;
use Laler\Dumpers\TauriDumper;
$manager = app(DumpCaptureManager::class);
if (app()->environment('local')) {
$manager->register(new TauriDumper('http://localhost:3000'));
}
laler('Hello from Laler!'); // Routed to the Tauri desktop appEnable automatic forwarding of executed queries to your configured dumpers:
// Start listening for queries (typically in a tinker session or controller)
laler_show_queries();
User::firstWhere('email', '[email protected]');
// Stop when you're done
laler_stop_showing_queries();Each query is sent as an array with the SQL, bindings, execution time (ms), and connection name, so dumpers like the desktop app can display them clearly.
For projects without Laravel, use the global helper functions. Here's the complete example from examples/plain_php_usage.php:
<?php
declare(strict_types=1);
// Optional: Add custom helper functions
if (!function_exists('now')) {
class LalerPlainPhpNow extends \DateTimeImmutable
{
public function toISOString(): string
{
return $this->format(DATE_ATOM);
}
}
function now(): LalerPlainPhpNow
{
return new LalerPlainPhpNow();
}
}
require_once __DIR__ . '/vendor/autoload.php';
use Laler\Dumpers\TauriDumper;
$manager = laler_manager();
$manager->register(new TauriDumper('http://localhost:3000'));
// Dumps now show in the desktop app
laler(['data' => ['nested' => 'structure']]);To send dumps to the Windows desktop app, use the TauriDumper:
use Laler\Dumpers\TauriDumper;
// Get the global manager and register the desktop app dumper
$manager = laler_manager();
$manager->register(new TauriDumper('http://localhost:3000'));
// Now all laler() calls will appear in the desktop app
laler('Debug message');
laler(['user_data' => $userData]);Tip: Start the desktop app first, then run your PHP code to see dumps in real-time.
vendor/bin/phpunit --stop-on-failure# Install npm dependencies for release tooling
npm install
# Create a new release (automatically determines version bump)
npm run release
# Or specify version bump type
npm run release:patch # 1.0.1 -> 1.0.2
npm run release:minor # 1.0.1 -> 1.1.0
npm run release:major # 1.0.1 -> 2.0.0- Commit format: Use conventional commits (
feat:,fix:,docs:, etc.) - Interactive commits: Run
npm run commitfor guided commit creation - Commit tooling:
@programinglive/commitermanages Husky/commitlint hooks—runnpx @programinglive/commiterafter cloning if hooks are missing - Release scripts: Use
npm run release[:patch|:minor|:major]to produce semantic, icon-rich changelogs - Follow the existing code style
- Remove unused imports before committing
- Run tests before submitting
MIT