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

Global Ray Laravel Package

spatie/global-ray

Globally install this package to send debug output from any PHP app to Ray using ray(), rd(), dump(), and dd() in any PHP file, no per-project setup required.

View on GitHub
Deep Wiki
Context7

spatie/global-ray installs globally and wires Ray into every PHP process, so ray(), rd(), dump() and dd() work in any PHP file — no per-project dependency, no framework required.

Running composer global require spatie/global-ray followed by global-ray install adds an auto_prepend_file entry to your php.ini, bootstrapping Ray before your own code runs.

  • Works in any PHP app, script, or CLI tool
  • Supports every Ray PHP method, including HTML, Markdown, and queries
  • Measure performance and pause execution from anywhere
  • One-time global install, zero project changes
Frequently asked questions about Global Ray
How do I install spatie/global-ray?
Run composer global require spatie/global-ray, then run global-ray install. The installer adds an auto_prepend_file entry pointing to global-ray-loader.php in your php.ini. After that, ray(), rd(), dump() and dd() are available in every PHP file without per-project setup.
Does spatie/global-ray work with Laravel?
It works alongside Laravel, but it is not a Laravel package and does not belong in your project dependencies. If a framework-specific integration such as spatie/laravel-ray is detected, that integration is used instead of global-ray. Treat global-ray as a fallback for one-off scripts, legacy non-framework PHP and CLI tools.
Do I need to add spatie/global-ray to my project's composer.json?
No. It is installed globally with composer global require, so nothing appears in composer.json, composer.lock or your build artifacts. That also means there is no version pinning or code review gate for the tool on a per-repository basis.
How do I uninstall spatie/global-ray?
Run global-ray uninstall first, then composer global remove spatie/global-ray. The order matters: the php.ini edit survives removing the package, so removing the Composer package first leaves a dangling auto_prepend_file pointing at a deleted loader script. That misconfiguration breaks every PHP process on the machine.
Why do all my PHP commands fail after upgrading PHP with global-ray installed?
auto_prepend_file is evaluated before your code runs, so a broken loader takes down artisan, composer, PHPUnit and PHPStan at the same time with an early, confusing error. The package ships version-pinned PHAR payloads per PHP version, so switching PHP versions can point the loader at the wrong binary. Re-run global-ray install after any PHP upgrade or version switch.
Do I need a paid Ray license to use spatie/global-ray?
The global-ray package itself is open source and free to install, but it sends output to Ray, which is a commercial desktop app. The free trial allows 20 messages per session, and full use requires a purchased license. Budget for Ray seats if you plan to roll this out across a team.
Is it safe to use global-ray in CI pipelines or Docker containers?
No. Restrict it to individual developer workstations. Auto-prepending debug functions into CI runners, shared build agents or container images silently changes the execution environment of your pipelines and injects globals into code you did not write.
What is the difference between spatie/global-ray and spatie/laravel-ray?
spatie/laravel-ray is a per-project Composer dependency with a pinned version in composer.json, intended for Laravel applications. spatie/global-ray is a machine-level tool that injects ray(), rd(), dump() and dd() into every PHP process and defers to laravel-ray when it is present. Use laravel-ray inside Laravel projects and scope global-ray to scripts that live outside a framework.
Which PHP versions does spatie/global-ray support?
It targets modern PHP releases and ships separate PHAR payloads per PHP version, with support added over time for releases such as PHP 8.2. Because the loader is pinned to a PHP-specific PHAR, upgrading or switching PHP usually requires re-running global-ray install to restore working debug functions.
Does global-ray work on Windows, Laravel Herd and Valet?
Yes. The installer has explicit Windows support, including an elevation retry when writing php.ini, and it handles the macOS Herd and Valet php.ini path differences. Which config file actually gets edited depends on your local setup, so verify the php.ini path after installing.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections