Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Global Ray Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Enable Ray in all PHP files on your system

Frequently asked questions about Global Ray
How do I install spatie/global-ray for Laravel and use ray() globally?
Run `composer global require spatie/global-ray` and execute `global-ray install`. This modifies your `php.ini` to load Ray’s helper functions globally, so you can call `ray()` in any PHP file—Laravel or otherwise—without requiring the package in each project.
Will this work with Laravel’s built-in dump() and dd() functions?
Yes, but for custom output (e.g., HTML, queries, or formatted arrays), use `ray()` explicitly. Laravel’s `dump()`/`dd()` rely on the Symfony VarDumper, while `ray()` sends data to the Ray desktop app with richer formatting and interactivity.
Does spatie/global-ray support PHP 8.0 or older versions?
The package is officially tested on PHP 8.1+. While it may work on older versions, Spatie recommends PHP 8.1+ for stability, especially if using Ray’s advanced features like performance profiling or AI interaction via MCP.
How do I prevent Ray from exposing sensitive data in production?
Disable Ray in production by setting `RAY_ENABLED=false` in your `.env` file. For local development, use Ray’s built-in redaction rules to mask secrets (e.g., passwords, API keys) by configuring them in the Ray desktop app’s settings.
Can I use this package in CI/CD pipelines without cluttering logs?
Yes, exclude CI environments by setting `RAY_ENABLED=false` in your `.env.ci` file. Alternatively, wrap `ray()` calls in environment checks like `if (!app()->environment('ci')) { ray($data); }` to avoid accidental debug output.
What’s the difference between this and Laravel Debugbar?
Laravel Debugbar is framework-specific and integrates with Laravel’s internals (e.g., queries, events). `spatie/global-ray` works across *any* PHP project, including CLI scripts and non-Laravel apps, and offers richer output (HTML, Markdown, performance metrics) via the Ray desktop app.
How do I measure performance with ray() in Laravel?
Use `ray()->performance()` to start a timer, then call `ray()->stopPerformance()` to log execution time. For example: `$timer = ray()->performance('query'); DB::query(...); ray()->stopPerformance($timer);`—this sends timing data to Ray’s desktop UI.
Does this package work with Docker or Kubernetes deployments?
Yes, but the Ray desktop app must connect to the PHP process via a shared socket (default: `unix:///tmp/ray.sock`). In Docker, ensure the socket path is accessible (e.g., mount `/tmp/ray.sock` as a volume) and configure Ray’s MCP server URL if using AI features.
Is there a free tier, or do I need to pay for Ray’s full features?
Ray offers a free trial with limited messages per session. Full features (e.g., performance profiling, AI interaction, and unlimited usage) require a paid license. The `spatie/global-ray` package itself is free and open-source.
How do I disable ray() globally for specific environments (e.g., staging)?
Set `RAY_ENABLED=false` in your `.env` file for staging. For granular control, use environment checks: `if (app()->environment('staging')) { return; } ray($data);`. The package respects these settings without requiring manual uninstallation.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport