Ray

A beautiful desktop debugging application for PHP, JavaScript, and other languages that transforms how developers investigate and fix issues in their code.

What Is Ray?

Ray is a desktop application available for macOS, Windows, and Linux that serves as a centralized debugging dashboard for your applications. Unlike traditional debugging tools that require complex configuration, Ray offers a beautifully designed interface where you can visualize variables, track performance metrics, and monitor database queries in real-time. Built by the team behind many popular Laravel packages, Ray has become an essential tool for developers who value both aesthetics and functionality in their development workflow.

The philosophy behind Ray is simplicity first. You don't need to configure breakpoints, set up remote debugging servers, or learn complex debugging protocols. Simply install the appropriate package for your language or framework, add a ray() call in your code, and immediately see the output in Ray's dedicated window. This approach makes Ray particularly valuable for developers who need quick insights into their application's state without interrupting their development flow.

The Ray Philosophy

The creators of Ray, Spatie, designed the tool around a pragmatic philosophy: developers need immediate visibility into their code's behavior without the friction that traditional debugging tools often introduce. This philosophy manifests in every aspect of Ray's design, from the simple installation process to the intuitive interface that displays debug information.

Traditional debugging with tools like XDebug requires configuring PHP extensions, setting up IDE integrations, and often dealing with performance overhead that slows down your entire development environment. Ray takes a fundamentally different approach by treating debug output as data that flows into a dedicated application, similar to how logging works but with rich visualization and interactivity. This approach works consistently across local development, staging environments, and production servers where full debugger setups might not be feasible. For teams implementing modern web development practices, Ray provides a streamlined debugging workflow that integrates seamlessly with contemporary development approaches.

Core Debugging Capabilities

Powerful features that make debugging faster and more intuitive

Variable Inspection

Display variables and data structures with syntax highlighting and collapsible sections for easy navigation of complex objects.

Color-Coded Output

Apply colors to organize debug output by type, severity, or any convention that helps you find information quickly.

Performance Measurement

Track execution time and memory usage with built-in measurement functions to identify bottlenecks.

Query Logging

Monitor database queries in real-time with execution times to identify slow queries and N+1 problems.

Supported Languages and Frameworks

Ray's support for multiple programming languages and frameworks makes it a versatile tool for full-stack developers working across different technologies. Understanding the breadth of Ray's ecosystem helps developers leverage the tool effectively regardless of their project stack.

PHP Ecosystem

PHP support represents Ray's strongest integration, reflecting its origins as a tool built by PHP developers for PHP developers. The framework-agnostic PHP package allows you to use Ray in any PHP project, while dedicated integrations provide enhanced functionality for popular frameworks.

For Laravel applications, Ray offers deep integration that transforms how you debug complex applications. The Laravel package includes specialized methods for inspecting Eloquent models with their attribute values, tracking database queries in real-time, monitoring mailables as they're sent, and capturing Laravel events as they fire during request processing. These Laravel-specific features make Ray particularly powerful for debugging the complex data flows typical of Laravel applications. Our Laravel development services leverage these debugging capabilities to maintain high code quality across projects.

Beyond Laravel, Ray provides integrations for WordPress, Drupal, Craft CMS, Yii, and Grav, each offering tailored functionality that respects the conventions and patterns of those frameworks. Whether you're debugging a custom WordPress plugin, a Drupal module, or a Craft CMS template, Ray adapts to provide relevant debugging information in a format that makes sense for that context.

PHP Integration

Ray's PHP integration provides a straightforward debugging experience whether you're working with vanilla PHP or a full-featured framework like Laravel. The basic usage pattern involves calling ray() with the value or values you want to inspect. For example, ray($user) displays a user object, while ray('Processing started') logs a message to help you track execution flow.

For more sophisticated debugging, Ray provides method chaining that allows you to apply colors, create named outputs, and perform additional processing. For instance, ray($data)->color('red') displays the data with a red color tag, making it stand out in your debugging session. The Laravel package extends this with framework-specific methods like ray()->showQueries() to enable query logging, ray($model) to display Eloquent models with all attributes, and ray($mailable) to inspect mailables before sending.

ray($user);
ray('Processing started');
ray($data)->color('red');
ray()->showQueries();

Laravel Integration Deep Dive

Laravel integration represents Ray's most sophisticated framework support, reflecting both the tool's origins and the Laravel community's enthusiastic adoption of Ray. Understanding these integrations helps Laravel developers maximize their debugging efficiency and transform how they investigate issues in their applications. When building robust web applications, having powerful debugging tools like Ray becomes essential for maintaining code quality and rapid issue resolution.

Laravel-Specific Features

Deep integration with Laravel's ecosystem for powerful debugging

Model Inspection

View Eloquent models with all attributes, relationships, and computed properties in a clean, readable format.

Query Tracking

Log all database queries with execution times to identify slow queries and N+1 problems.

Event Monitoring

Capture and display Laravel events as they fire during request processing.

Mailable Preview

Inspect mailables before they're sent to see exactly what recipients will receive.

Logger Integration

Automatically capture Laravel log output alongside explicit debugging calls.

Blade Debugging

Debug data directly in Blade templates without polluting your views.

Remote Debugging and Production Use

One of Ray's most powerful capabilities is debugging applications running on remote servers, including production environments. This feature extends Ray's utility beyond local development to encompass the entire application lifecycle.

SSH Tunnel Configuration

Ray uses SSH tunneling to securely transmit debug information from remote servers to your local Ray application. This approach ensures that debug output travels through encrypted channels while maintaining the simplicity that characterizes Ray's design. Setting up remote debugging requires configuring SSH access to your server and installing the Ray package in your application. Once configured, all ray() calls on the remote server appear in your local Ray application as if the code were running locally. The SSH tunneling approach means you don't need to expose your application or Ray directly to the network, maintaining security while providing debugging capabilities.

Production Debugging Scenarios

Debugging production environments requires careful consideration of both technical and ethical factors. While Ray makes production debugging technically feasible, developers must use these capabilities responsibly. Appropriate production debugging scenarios include investigating specific user-reported issues that can't be reproduced in staging environments, debugging race conditions or timing issues that only manifest under production load, and verifying that fixes applied to production behave as expected. Best practices include scoping debug output to specific user sessions or request IDs, using conditional debug calls that don't execute in normal production traffic, and removing or disabling debug calls once the issue is resolved. For complex web application development projects, having remote debugging capabilities like Ray's SSH tunneling is invaluable for maintaining application health in production environments.

Getting Started with Ray

Adopting Ray in your development workflow involves installing the appropriate package for your language and framework, then incorporating ray() calls into your debugging practice. The straightforward setup process means you can be debugging within minutes.

Installation

Installation varies by language and framework but follows a consistent pattern of adding a package dependency and configuring any necessary credentials. For Laravel applications, the process involves adding the spatie/laravel-ray package via Composer and optionally configuring settings in your .env file. Vanilla PHP projects use the spatie/ray package directly, which can be installed through Composer and initialized with a simple configuration call. JavaScript projects install the appropriate npm or yarn package and import the ray function in their code. After package installation, you'll need to download and install the Ray desktop application from the official website. The desktop application is available for macOS, Windows, and Linux, ensuring compatibility with your development environment.

Basic Usage Patterns

The basic usage pattern for Ray involves calling ray() with the value or values you want to inspect. For more sophisticated debugging, Ray provides method chaining that allows you to apply colors, create named outputs, and perform additional processing. Learning to use Ray effectively involves developing personal conventions for when to use debugging versus logging, how to color-code different types of output, and when to use performance measurement features. These conventions become second nature with practice, and Ray's simplicity makes developing them straightforward.

Pricing and Availability

Simple, transparent pricing for individuals and teams

Single License

For individual developers who need Ray on two computers

  • Desktop app for Mac, Windows, and Linux
  • Activate on 2 computers
  • 1 year of updates and new features
  • Access to all language integrations
  • Free demo available to try first

Best Practices for Effective Debugging

Effective use of Ray involves more than knowing the API calls--it requires developing debugging strategies that leverage Ray's capabilities efficiently. These best practices help developers get maximum value from the tool.

Strategic Debug Output Placement

Strategic placement of debugging calls maximizes the information you gain while minimizing the changes to your codebase. Rather than scattering ray() calls throughout your code, targeted placement at key decision points provides maximum insight with minimum noise. Effective debug placement typically focuses on entry and exit points of functions, places where data transformations occur, conditional branches that might not be executing as expected, and boundaries between different system components. As you develop proficiency with Ray, you'll naturally develop instincts for where debugging calls provide the most value.

Maintaining Clean Debugging Code

Maintaining clean debugging code prevents the accumulation of debug calls that can clutter your codebase and confuse future maintainers. One approach involves using environment variables or debug flags to conditionally execute debugging code, allowing debug calls to remain in the codebase without affecting production performance. Another approach involves grouping related debugging calls and using Ray's features to organize their output by applying consistent naming and color conventions.

Integrating with Development Workflow

Integrating Ray into your development workflow involves establishing team conventions and individual habits that make debugging more efficient. Team standards for debugging might include conventions for color usage, naming patterns for debug outputs, and guidelines for when to use debugging versus logging. Individual habits that improve debugging efficiency include keeping Ray running during development sessions, using Ray's history and search features to revisit previous outputs, and developing the discipline to remove or disable debugging code once issues are resolved.

Comparison with Alternative Debugging Tools

Understanding how Ray compares to alternative debugging tools helps developers make informed decisions about when to use each approach. Each tool has strengths that make it appropriate for different scenarios.

Ray vs. XDebug and Step Debuggers

Traditional step debuggers like XDebug offer capabilities that Ray doesn't attempt to replicate, particularly breakpoint-based debugging where you pause execution and step through code line by line. These tools provide capabilities essential for understanding complex control flow and debugging issues that require examining execution state at specific points. Ray's dump-based approach complements step debugging by providing faster access to specific information without the overhead of breakpoint configuration. For many debugging scenarios--inspecting variable values, tracking query execution, monitoring performance--Ray provides a more efficient workflow than stepping through code. The most effective debugging practice often involves both approaches: using Ray for initial investigation and verification, then switching to step debugging when deeper inspection of execution flow is necessary. When debugging redirects in Next.js or other routing issues, Ray provides quick visibility into request flow that complements traditional debugging approaches.

Ray vs. Browser Developer Tools

Browser developer tools provide essential capabilities for frontend debugging that Ray doesn't replace, particularly DOM inspection, network request monitoring, and JavaScript execution profiling. These tools remain essential for frontend development. Ray complements browser tools by providing an alternative output channel for JavaScript debugging. When debugging complex JavaScript logic, particularly in frameworks like React or Vue, Ray's output can provide additional perspective alongside browser console logging. The combination of browser tools and Ray creates a more complete debugging toolkit for JavaScript development. For debugging CSS layout issues like z-index stacking contexts, browser dev tools remain essential while Ray helps you trace JavaScript execution flow.

Conclusion

Ray represents a significant advancement in developer debugging tools, combining powerful capabilities with elegant simplicity. The tool's multi-language support, deep framework integrations, and beautiful interface make it valuable for developers across the full spectrum of web development technologies. For PHP and Laravel developers specifically, Ray offers debugging capabilities that significantly improve development velocity and reduce the friction of investigating issues. The Laravel integrations alone justify exploring the tool for any Laravel development work.

The straightforward pricing, comprehensive documentation, and free trial option make adopting Ray a low-risk decision. Developers and teams can evaluate the tool in their actual workflow before committing, ensuring that Ray genuinely improves their debugging practice before investment. Whether you're debugging locally, investigating staging issues, or diagnosing problems in production, Ray provides a consistent, powerful debugging experience that adapts to your needs. Our custom web development team regularly uses Ray to maintain high code quality and rapid issue resolution across projects. For organizations exploring AI-powered development workflows, Ray's debugging capabilities integrate well with modern development practices that emphasize efficiency and rapid iteration.

Frequently Asked Questions

Ready to Transform Your Debugging Workflow?

Ray's beautiful interface and powerful features make debugging faster and more intuitive. Try the free demo to see how Ray can improve your development process.

Sources

  1. Spatie Ray Product Page - Official product information and pricing
  2. Ray Documentation - Comprehensive multi-language documentation
  3. Laravel News: Ray Desktop Debugging for PHP - In-depth review of Laravel integration features