Weave 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

Ray Laravel Package

spatie/ray

spatie/ray sends debug output from any PHP app to Ray, Spatie's desktop debugging app. Dump arrays, HTML, queries, and Markdown, measure performance, pause execution, and inspect output with the same syntax you use across Laravel, JavaScript, and more.

View on GitHub
Deep Wiki
Context7

spatie/ray is the official PHP client for Ray, Spatie's desktop debugging app. Install it in any PHP application to send rich debug output from your code straight to a beautiful, standalone desktop window—no more messy var_dump() output buried in browser or terminal logs.

Ray keeps the instant feedback of dump() while letting you use consistent debugging syntax across Laravel, plain PHP, JavaScript, and more.

  • Send any value: strings, arrays, objects, HTML, SQL queries, and Markdown files
  • Measure performance and pause execution directly from your PHP code
  • Interact with AI output via the built-in MCP server
  • Beautiful themes to match your workflow
  • Works in any PHP application, not just Laravel

A free trial lets you send up to 20 messages per session; a license unlocks full access.

Frequently asked questions about Ray
How do I install spatie/ray in a Laravel application?
Use composer require --dev spatie/laravel-ray for Laravel apps, which brings in spatie/ray as the underlying package; for plain PHP use composer require --dev spatie/ray. Laravel users can publish the config with php artisan vendor:publish and review host and port settings. Keep it in require-dev so it is not part of production dependencies.
Does spatie/ray support Laravel 12 and PHP 8.4?
The changelog shows current compatibility work for PHP 8.4 and 8.5 as well as Laravel 12 and 13. Always check the package constraints and changelog for your exact PHP, Laravel, and PHPStan versions. Teams on older PHP or PHPStan 0.x should pilot first.
What is the difference between spatie/ray and spatie/laravel-ray?
spatie/ray is the core package for any PHP app, while spatie/laravel-ray is the Laravel-specific wrapper that adds framework integrations. Laravel teams should standardize on spatie/laravel-ray rather than integrating the core package alone. The wrapper still sends payloads to the Ray desktop app over HTTP.
How do I configure the Ray host and port for Docker or WSL?
Publish ray.php and set the host and port so the package can reach the Ray desktop app from your container or WSL environment. Docker and remote-development setups often need host.docker.internal or the host machine's LAN address instead of localhost. Verify local firewall rules and that Ray is listening on the expected interface.
Can spatie/ray leak secrets or sensitive data in production?
Ray calls can send secrets, PII, SQL, and request payloads to the desktop app, so they should never carry sensitive production data. The bigger risk is leaving ray() calls enabled in shared staging or production, which can create local network traffic and data exposure. Gate enablement by environment and enforce removal before merge or release.
How do I prevent ray() calls from being merged or deployed to production?
The package includes PHPStan and Rector rules to detect and remove stray ray() calls. Wire the PHPStan rule into CI so pull requests fail when debug calls are present, and use the Rector rule during cleanup. Also keep spatie/ray in require-dev and review exceptions for intentional diagnostic code.
What alternatives to spatie/ray should I consider for Laravel debugging?
Alternatives include Xdebug for step debugging, Laravel Telescope for request and query inspection, and structured logs or dump/dd for quick checks. Ray is strongest when you want one consistent syntax across languages and structured payloads in a desktop app. Many teams use Ray alongside these tools rather than choosing only one.
Does spatie/ray work in PHPUnit or Pest tests?
You can use ray() calls while running PHPUnit or Pest tests to inspect values and test flow. Since test runs can generate many messages, use it selectively and avoid leaving debug calls in committed tests. The package's own test suite runs with composer test, and CI can enforce removal rules.
What license do I need for Ray, and is spatie/ray free?
The spatie/ray Composer package is MIT-licensed and free to install. The Ray desktop app is commercially licensed, with a free trial that allows up to 20 messages per session before you buy a license. Budget for per-seat licensing and approval for desktop app installation.
Is spatie/ray actively maintained and safe to adopt?
Upstream maintenance appears active, with frequent releases and compatibility fixes across PHP, Laravel, Symfony, and PHPStan. Pin versions, monitor the changelog, and periodically verify compatibility with your stack. The main operational concerns are licensing, desktop-environment dependencies, and enforcing removal of debug calls.
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.
muka/shape-reader
tdt/json
refinery29/php-cs-fixer-config
hotmeteor/eco-env
mvaliolahi/hydrate
wearede/tbcpay-php
parsnick/steak
thibaud-dauce/mattermost-php
multilinguals/apollo-client
antaresbr/collection
kr0lik/phpstan-rules
loco/loco
starfederation/datastar-php
yupmin/modern-phystrix
stephenjude/extended-artisan-commands
lumphp/laravel-macroable
lumphp/laravel-collections
lumphp/laravel-contracts
sermepa/sermepa
arkecosystem/fortify