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().
php artisan ray:publish-config2. Point Ray at Buggregator
Set two lines in .env. In Docker Compose, use RAY_HOST=ray@buggregator and RAY_PORT=8000.
RAY_HOST=ray@127.0.0.1
RAY_PORT=80003. 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
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.
Related tips
- Dumps
dump() without breaking your page or JSON response
Send Symfony VarDumper output to Buggregator with two env vars. dump() stops landing in your HTML or JSON and shows the file and line it came from.
- Logs
Laravel logs from web, queue and cron in one live view
Add a socket channel to config/logging.php and set LOG_CHANNEL=socket. Laravel logs from requests, queue workers and cron jobs appear live in Buggregator.
- HTTP
See every API call your Laravel app sends
Set global proxy options for Laravel's HTTP client in AppServiceProvider. Every Http:: request and response shows up in Buggregator. Local only.
Checked on with Buggregator v2.8.0