Skip to main content

Send ray() calls to a free local viewer

If you use Ray in Laravel, publish the Ray config and set RAY_HOST=ray@127.0.0.1 and RAY_PORT=8000. Your ray() calls then land in Buggregator, a free viewer under the MIT license, next to your exceptions, logs and emails. You keep the same ray() function and the same workflow; no license is needed.

Steps

1. Publish the Ray config

Run this in your Laravel app, which already uses ray().

bash
php artisan ray:publish-config

2. Point Ray at Buggregator

Set two lines in .env. In Docker Compose, use RAY_HOST=ray@buggregator and RAY_PORT=8000.

dotenv
RAY_HOST=ray@127.0.0.1
RAY_PORT=8000

3. Call ray() as usual

Open http://127.0.0.1:8000. Buggregator renders 17 Ray payload types, among them SQL queries with bindings, Eloquent models, jobs, events, mailables, tables, measures and exceptions with stack traces. Each payload shows its origin: file, line and function. Click the file path to open it in your IDE.

4. Outside Laravel, use a ray.php file

In any other PHP project, create ray.php in the project root.

php
<?php

return [
    'enable' => true,
    'host' => 'ray@127.0.0.1',
    'port' => 8000,
    'remote_path' => null,
    'local_path' => null,
    'always_send_raw_values' => false,
];

Why it works

Ray sends each call to the host and port you set. Buggregator takes Ray payloads on port 8000, the same port as its UI and its other HTTP events, and shows them with the rest of your debug data. Ray by Spatie also has SDKs for JavaScript, Ruby, Go and Bash, and their output goes to Buggregator too.

Checked on with Buggregator v2.8.0

Setup in 60 seconds

No registration. No account. Start it and point your app at it.

1

Start Buggregator

One file, installed with one command. The web UI opens on port 8000. Prefer containers? Use the Docker tab.

$ curl -fsSL https://raw.githubusercontent.com/buggregator/server/master/scripts/install.sh | sh
$ HTTP_ADDR=127.0.0.1:8000 \
  SMTP_ADDR=127.0.0.1:1025 \
  VAR_DUMPER_ADDR=127.0.0.1:9912 \
  MONOLOG_ADDR=127.0.0.1:9913 \
  PROXY_ADDR=127.0.0.1:8080 \
  ~/.local/bin/buggregator

The script picks the file for your CPU: Intel/AMD or ARM.

One file for Linux, macOS and Windows, about 40 MB. Nothing else to install.

This run line keeps it on this computer. Without the *_ADDR settings it listens on all network interfaces →

Rather not run a script? Download the file yourself →

Runs on Windows, macOS and Linux, on Intel/AMD and ARM.

Prefer not to do it yourself? Your AI agent can set Buggregator up for you →