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
Laravel Ray

Laravel Ray Laravel Package

spatie/laravel-ray

Send Laravel debug output to Ray, Spatie’s desktop debugger. Use a consistent “ray()” API to inspect variables, arrays, HTML, queries, and more, measure performance, and pause execution. Works alongside PHP, JS, and other integrations.

View on GitHub
Deep Wiki
Context7

spatie/laravel-ray integrates Laravel with Ray, Spatie’s desktop debugging app, so you can send rich debug output straight from your code with a consistent, dump()-like experience across PHP and more.

Use Ray to inspect data, performance, and execution flow without cluttering your response output—perfect for local development and deep debugging sessions.

  • Send arrays, HTML, queries, Markdown, and more to Ray
  • Measure performance and profile execution
  • Pause execution during debugging
  • Inspect and interact with output, including via Ray’s MCP server
  • Enjoy polished themes and a dedicated desktop UI
Frequently asked questions about Laravel Ray
How do I install spatie/laravel-ray in a Laravel project?
Run `composer require spatie/laravel-ray` and execute `php artisan ray:install`. The package adds a `ray()` helper and Blade directive `@ray` for debugging. No additional configuration is needed for basic usage, but check `.env` for environment-specific settings.
Does spatie/laravel-ray work with Laravel 13 or 11?
Yes, the package officially supports Laravel 11–13 (as of v1.43.6). Older versions (e.g., Laravel 10) may require manual adjustments, but the package maintains backward compatibility. Always check the [CHANGELOG](https://github.com/spatie/laravel-ray/blob/main/CHANGELOG.md) for version-specific notes.
Can I use ray() in production without performance overhead?
Ray output is disabled in production by default. Use `if (app()->environment('local')) ray($data);` or set `RAY_ENABLED=false` in `.env` to prevent accidental leaks. The package adds negligible overhead (~1–5ms per call) only when active.
How does ray() compare to Laravel Telescope or Xdebug?
Ray offers a lightweight, desktop-based alternative to Telescope’s web UI and Xdebug’s IDE integration. Unlike Telescope, it’s not a full monitoring tool, but it excels at real-time inspection of variables, HTML, and performance metrics—ideal for local debugging. Use Telescope for production monitoring and Ray for deep local sessions.
Will ray() expose sensitive data like API tokens or PII?
Yes, if used carelessly. Always wrap `ray()` calls in `if (app()->environment('local'))` checks. For extra safety, use context filters (e.g., `ray($data)->except(['password', 'token'])`) or avoid sending sensitive data entirely. Ray messages are local-only by default.
Can I measure performance with ray() like in Laravel’s built-in tools?
Yes, Ray includes performance measurement tools. Use `ray()->performance('section_name')` to time execution blocks. The desktop app displays execution time, memory usage, and even allows pausing execution during debugging—similar to Xdebug but without IDE dependencies.
How do I debug Blade templates or Eloquent queries with Ray?
Use the `@ray` Blade directive to inspect template variables or wrap Eloquent queries in `ray()` calls. For advanced query debugging, enable the built-in query watcher via `ray()->enableQueryWatcher()` in your `AppServiceProvider`. Ray will log raw SQL, bindings, and execution time.
Does spatie/laravel-ray support JavaScript/TypeScript debugging alongside PHP?
Yes, Ray is a cross-language tool. Install the [JavaScript/TypeScript client](https://myray.app/docs/javascript) to send debug output from Laravel Mix/Vite or frontend frameworks. All messages appear in the same Ray desktop UI, enabling full-stack debugging without context-switching.
Are there alternatives to spatie/laravel-ray for Laravel debugging?
For local debugging, consider Laravel Telescope (web-based), Xdebug (IDE integration), or Laravel’s built-in `dd()`/`dump()`. For cross-language debugging, Ray is unique in its desktop-first approach. If you need production monitoring, Telescope or Laravel Debugbar are better choices.
How do I clean up old Ray messages or reset the app?
Run `php artisan ray:clean` to clear stored messages. This uses Rector under the hood, so avoid running it in production unless necessary. For persistent issues, check Ray’s settings or reinstall the package (`composer remove spatie/laravel-ray && composer require spatie/laravel-ray`).
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