Weave Code
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

X Ray Laravel Package

spatie/x-ray

Scan your codebase for Ray debugging calls (ray(), rd(), Ray::*, ->ray()) and list where they occur so you can remove them before deploy. Supports multiple paths, ignores, snippets/summary, GitHub Actions annotations, and CI-friendly exit codes.

View on GitHub
Deep Wiki
Context7

Scan source code for calls to ray() and related calls.

Frequently asked questions about X Ray
How do I install spatie/x-ray for Laravel projects?
Run `composer require spatie/x-ray --dev` in your project directory. The package is designed as a development dependency to avoid bloating production builds. It integrates seamlessly with Laravel’s Composer ecosystem.
Does spatie/x-ray work with Laravel’s service container or Facade calls to Ray?
Yes, it detects all Ray-related calls, including Facade methods like `Ray::debug()`, `->ray()`, and even dynamic calls via the service container. It uses static analysis to identify usage patterns across your entire codebase.
Can I use spatie/x-ray in GitHub Actions to block deployments with leftover Ray calls?
Absolutely. Use the `--github` flag to generate GitHub Actions annotations, and set the workflow to fail if the exit code is non-zero. Example: `run: ./vendor/bin/x-ray scan --github && exit $?`.
What Laravel versions does spatie/x-ray support?
The package works with any Laravel version that uses Ray (v1.0+). It’s not Laravel-specific but focuses on Ray debugging calls, so it’s compatible with Laravel 8.x, 9.x, and 10.x. Test thoroughly if using older Laravel 7.x.
How do I ignore specific files or directories from the scan?
Use the `--ignore` flag repeatedly. For example, `./vendor/bin/x-ray --ignore tests/Unit --ignore config/ ./app` skips those paths. You can also ignore glob patterns like `--ignore 'app/Console/*.php'`.
Will spatie/x-ray generate false positives for non-Ray calls (e.g., custom methods named `ray`)?
It’s possible, especially in dynamic code or reflection-heavy projects. To mitigate this, use the `--snippets` flag to review context or whitelist paths/files with `--ignore`. Custom PHPStan rules can further refine accuracy.
Can I integrate spatie/x-ray into my CI pipeline to enforce Ray cleanup?
Yes. Add it to your CI (e.g., GitHub Actions, GitLab CI) with a step like `run: ./vendor/bin/x-ray scan && exit $?`. The non-zero exit code on Ray detections makes it ideal for blocking merges or deployments.
Does spatie/x-ray modify files or only report findings?
It **only reports** findings—no files are altered. The tool outputs locations of Ray calls (e.g., line numbers, snippets) so you can manually remove them before deployment. This ensures safety in CI/CD pipelines.
Are there alternatives to spatie/x-ray for scanning Ray calls?
Manual searches with `grep` or `ripgrep` (`rg 'ray('`) are alternatives, but they lack CI integration and structured output. For deeper analysis, consider PHPStan with custom rules, though spatie/x-ray is optimized for Ray-specific scans.
How do I customize spatie/x-ray to handle project-specific Ray usage (e.g., allow in tests)?
Use the `--ignore` flag for directories like `--ignore tests/` or extend PHPStan rules for granular control. For advanced cases, fork the package or create a custom PhpParser-based scanner to override default behavior.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport