spatie/global-ray
Install Ray globally to use ray(), rd(), dump() and dd() in any PHP project. Send debug output (arrays, HTML, queries, markdown) to the Ray desktop app, measure performance, and pause execution—same debugging workflow across frameworks and plain PHP.
dump(), log()) is critical. Complements existing tools like Laravel Debugbar or Tideways.spatie/global-ray) with zero config for basic usage. Ray’s desktop app must be installed separately.dump()/dd() but requires explicit ray() calls for custom output.app()).autoload).ray() calls).local only)?dump()/dd(); minimal changes needed. For non-Laravel PHP, requires explicit ray() calls.composer global require spatie/global-ray.php artisan tinker or CLI scripts).composer.json (if project-specific): "spatie/global-ray": "^1.0"..env):
RAY_ENABLED=true
RAY_MCP_SERVER=https://mcp.myray.app # For AI features
dd() with ray()->dd() for custom formatting (e.g., HTML tables).AppServiceProvider to auto-wrap dump():
if (app()->environment('local')) {
\Spatie\GlobalRay\Ray::enable();
}
RAY_ENABLED=false in .env.ci).ray() calls with sensitive data.8000 by default).ray() in loops)..env guards: RAY_ENABLED=app()->environment('local').RAY_ENABLED=true in non-local environments.composer global. Project-specific installs avoid this.ray()->table(), ray()->pause()).RAY_ENABLED=true and Ray’s desktop app is running.ray() calls may lag UI; use batching or sampling.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Ray app crashes | Debugging halts | Fallback to var_dump() or Laravel logs. |
| MCP server downtime (AI features) | AI-assisted debugging unavailable | Use local-only features until resolved. |
| Accidental production enablement | Sensitive data exposure | Strict .env validation + CI checks. |
High ray() usage in loops |
UI lag or app slowdown | Rate-limit or sample output (e.g., ray()->every(10)). |
| Global install conflicts | Version clashes across projects | Prefer project-specific installs. |
dd() to Ray’s UI. Resist with:
ray()->pause()).ray() call).ray() in production").How can I help you explore Laravel packages today?