As Laravel developers we are all familiar with Spatie and their significant contribution either to the framework itself or with the high quality laravel packages they develop. Most of us (including Taylor Otwell himself) are using Ray which is a beautiful and lightweight tool enhancing the dd() or dump() functionality.
While Ray is great, you still have to install it per project in order to be able to use it and when you're not in that project's context, you either pull in ray via composer or in some cases you can't use it at all.
Recently, Freek Van der Herten from Spatie announced the release of Global Ray.
🚀 Global Ray has been released.https://t.co/t6XZgubgpR
— Freek Van der Herten 🔭 (@freekmurze) March 4, 2022
It allows you to use "dd()”, "dump()” and "ray()” in any PHP file on your system.#laravel #php #package pic.twitter.com/0s9WFlavCz
Global Ray allows you to use dd(), dump() and ray() functions globally without being limited to the project's context as before.
Getting started with Global Ray
You can install Global Ray, globally with just two shell commands:
1composer global require spatie/global-ray2global-ray install

The install command will register global-ray-loader.php in the auto_prepend_file directive of your php.ini. This means that Global Ray will start when PHP starts.
More about how everything works in Freek's release post.
Happy debugging!
Written by
Writing and maintaining @LaravelMagazine. Host of "The Laravel Magazine Podcast". Pronouns: vi/vim.
Get latest news, tutorials, community articles and podcast episodes delivered to your inbox.