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.
Yii::debug(), Yii::error()) with Ray, a cross-framework debugging tool. This is a high-fit for Yii2 applications where real-time debugging (e.g., query inspection, variable dumps, performance metrics) is critical but lacks a modern UI.yii\base\Application events like on beforeAction or on afterAction).YII_DEBUG mode) and Ray’s client-side rendering.Spatie\YiiRay\YiiRay::init() to config/web.php).yii-debug-toolbar) if both are enabled.Yii::debug() to Ray for critical debugging (e.g., complex queries, API responses)?yii\base\Application events (e.g., on beginRequest, on endRequest).yii\log\Logger for intercepting log messages.yii\db\Command for query logging.Yii::debug() with Ray::debug() in key components.config/web.php:
'components' => [
'yiiRay' => [
'class' => \Spatie\YiiRay\YiiRay::class,
'mcpServer' => env('RAY_MCP_SERVER', 'http://localhost:8080'),
],
],
.env for MCP server URL (local/cloud).yii-debug-toolbar, ensure Ray’s output doesn’t duplicate or interfere.docker run -p 8080:8080 -v ray-data:/ray-data spatie/ray
composer require spatie/yii-ray
yiiRay component to config/web.php.YII_DEBUG = true in .env.Ray::debug($variable) or Ray::ray($object) in controllers/models.spatie/yii-ray for Yii2 version support (e.g., if Yii2 3.0 is released).RAY_MCP_SERVER URL).YII_DEBUG = true).stdout (Docker) or system logs.ActiveRecord results) may add <50ms latency per request. Mitigate by:
Ray::ignore() for non-critical paths.YII_DEBUG = false).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| MCP server downtime (local/cloud) | Debug messages lost | Fallback to Yii::debug() or file logging. |
| Network latency to MCP server | Debug UI lag | Use local MCP for dev; prioritize critical paths. |
| Ray app crashes | Debug |
How can I help you explore Laravel packages today?