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

Yii Ray Laravel Package

spatie/yii-ray

Yii2 integration for Spatie Ray desktop debugger. Send dumps, arrays, HTML, queries, and more from your Yii2 app to Ray for faster debugging. Includes performance tools and the same Ray API used across PHP frameworks.

View on GitHub
Deep Wiki
Context7

Debug with Ray to fix problems faster in Yii apps

Frequently asked questions about Yii Ray
How do I install spatie/yii-ray in my Yii2 project?
Run `composer require spatie/yii-ray` in your Yii2 project directory. Then, initialize Ray in your `config/web.php` by adding the YiiRay component to the `components` array. Follow the [official Yii2 Ray docs](https://myray.app/docs/php/yii/getting-started) for step-by-step setup.
Does spatie/yii-ray work with Yii2’s built-in debug tools like Yii::debug()?
Yes, it integrates seamlessly with Yii2’s native debugging methods. You can replace `Yii::debug()` calls with `Ray::debug()` or `Ray::info()`, and all output will appear in the Ray desktop app. The package also intercepts Yii2’s log messages for centralized debugging.
What Yii2 versions does spatie/yii-ray support?
The package is designed for Yii2 (not Yii3 or Laravel). It supports Yii2’s LTS versions (e.g., 2.0.x) and later. Always check the [package’s changelog](https://github.com/spatie/yii-ray/blob/main/CHANGELOG.md) for version-specific notes before upgrading.
Can I use Ray’s pause execution feature in Yii2?
Yes, Ray’s pause execution feature works in Yii2. You can halt script execution mid-flow to inspect variables or debug complex logic, just like in Laravel or vanilla PHP. This is especially useful for debugging Yii2’s event-driven architecture (e.g., `on beforeAction`).
How does Ray handle sensitive data like API keys or PII in debug messages?
Ray does not automatically sanitize sensitive data. You must manually filter or redact sensitive information before sending it to Ray using PHP’s `var_export()` or custom logic. For production, consider disabling Ray entirely or using environment-based conditional logging (e.g., `YII_DEBUG` mode).
What’s the performance impact of using Ray in a high-traffic Yii2 app?
Ray introduces minimal overhead, primarily from serializing debug data. For production-like loads, test with tools like Blackfire or Xdebug to measure latency. Disable Ray in non-debug environments (e.g., via `YII_DEBUG = false`) to avoid any impact on performance.
Can I use Ray alongside Yii Debug Toolbar or Xdebug?
Yes, Ray can coexist with Yii Debug Toolbar or Xdebug. However, avoid sending duplicate debug data to both tools to prevent clutter. Ray’s strength lies in its desktop UI for complex data (e.g., arrays, queries), while Toolbar/Xdebug may suit simpler frontend debugging.
Do I need to self-host Ray’s MCP server, or can I use the cloud version?
You can use either. The free tier includes a cloud MCP server, but for local development or staging, self-hosting (via Docker or native install) is recommended to avoid latency. The cloud version is ideal for remote teams but may have rate limits or SLAs to consider.
How do I transition from Yii::debug() to Ray in my Yii2 app?
Start by replacing critical `Yii::debug()` calls with `Ray::debug()` in key components (e.g., controllers, models). Use Ray’s [performance tools](https://myray.app/docs/php/performance) to measure execution time for complex queries or API responses. Pilot in staging first to test the workflow.
What are the licensing costs for using Ray in production?
Ray offers a free tier with up to 20 messages per session, suitable for development. For production use, a paid license unlocks unlimited messages, advanced features, and cloud MCP hosting. Check [Spatie’s pricing page](https://spatie.be/products/ray) for details and team discounts.
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