- 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.