The Ray blog

Shining a light on internals and updates.

Leveraging the Power of Macros in Ray

One of Ray's powerful features you might not have heard of is adding your own logic to it via macros. Macros in Ray allow you to define custom methods that can be reused throughout your application, making debugging more efficient and tailored to your needs.


Clearing Ray output

Frequent Ray calls can lead to a long and cluttered Ray log. However, you can take control of the log and clear it at various tages of the application and testing lifecycle.


Ray now supports Laravel 11's Context

Laravel 11 recently introduced a nice new feature called Context. We’ve updated Ray with a convenient method to display all set context.


The ingredients we used for our new Ray docs

We recently revamped our Ray documentation. The goal was to give the docs a new home on the domain and make them easier to navigate by totally overhauling their structure and content. This blog post will give an overview of some packages, technologies, and techniques we used.


Adding wire:navigate to Markdown links

We just released our new Ray docs, check 'em out if you haven't already! They're hosted right here on and are extra snappy because they use Livewire's navigate feature. Here's how we added wire:navigate to all the links in our docs.


Pest comes with Ray integration out of the box

Pest is an excellent test runner for PHP, that’s been getting more popular. It offers a developer friendly way of writing tests. At Spatie, we use it for all our projects. Did you know that Pest comes with Ray support out of the box? Let’s take a look at this very simple test from one of our own packages.


Sniffing out stray ray() calls with Pest architecture testing

Whether you're building a shiny new feature or refactoring a bug deep in a legacy codebase, before you merge your work to production you want to get rid of all those ray() calls you littered the codebase with. You'll probably get rid of most of them on time, but every now and then a stray call gets forgotten during code review.


Find where a method was called in PHP

Methods that get called in a bunch of different places can be tricky to debug. Find out where your methods are called with debug_backtrace().


Copy output from Ray to your clipboard

At Spatie, we keep working on Ray continuously. We’re adding small quality-of-life improvements every week. We’re happy to announce that you can now copy logged arrays and objects to your clipboard from Ray.


Understand and fix bugs faster

Ray is a desktop application that serves as the dedicated home for debugging output. Send, format and filter debug information from both local projects and remote servers.