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.
dd(), dump(), and Laravel’s built-in logging. It integrates seamlessly with Laravel’s service container, Blade templates, and event system, making it a natural fit for teams already using Spatie’s tools (e.g., laravel-activitylog, laravel-permission).local only) without affecting production performance.spatie/ray) is isolated and version-locked. Composer’s autoloader handles conflicts gracefully..env or config). No runtime cost when inactive.ray() call), but batch processing (e.g., queue workers) may require monitoring for latency spikes.ray() is used with request payloads, tokens, or PII. Mitigation: Use context filters or environment checks (if (app()->environment('local'))).ray:clean command (v1.34.0+) uses Rector, which could conflict with existing codebase transformations.dd()/dump() entirely, or supplement them?RAY_ENABLED=false) to avoid accidental leaks?ray() cannot be used? If so, how will these be guarded?dd()?spatie/ray v2.0)?@ray), and service container. No need for monolithic refactoring.laravel-activitylog) and tools like Laravel Forge/Vapor for deployment-aware debugging.local or staging):
composer require spatie/laravel-ray
php artisan ray:install
.env:
RAY_ENABLED=true
RAY_PORT=8000
dd()/dump(): Use @ray in Blade or ray() in PHP for targeted debugging.'watchers' => [
\Spatie\Ray\Watchers\QueriesWatcher::class,
\Spatie\Ray\Watchers\ExceptionsWatcher::class,
],
UserService logs).RAY_ENABLED=false and validate no debug calls leak.ray() usage in non-local environments.^1.35.0 for Laravel 10 (deprecated in v1.36.0+).spatie/ray is a soft dependency; conflicts are rare. Use composer why-not to pre-check.zbateson/mail-mime-parser.composer.json:
"extra": {
"laravel": {
"providers": ["Spatie\\Ray\\RayServiceProvider"]
}
}
dd() with ray() in critical modules.ray() calls.^1.43 for Laravel 13). Updates are backward-compatible unless major Laravel versions change.composer why spatie/laravel-ray to track updates. Test in a staging branch before merging.php artisan ray:clean to remove debug calls in PRs (v1.34.0+).ray() calls with context labels (e.g., ray('User', ['id' => $user->id])).RAY_PORT and firewall rules.RAY_ENABLED=true and no environment filters block output.ray() calls in loops; use batch processing.storage/ray) can be inspected if the app crashes.How can I help you explore Laravel packages today?