beyondcode/laravel-view-xray
BeyondCode's Laravel View Xray lets you inspect Blade views directly in the browser. See which view file is rendered and what data it receives, making it easy to debug view composers, includes, and data issues in Laravel applications.
composer require beyondcode/laravel-view-xray --dev
The package is archived and its last release targets the Laravel 6/7/8 era. If Composer resolution fails on Laravel 9+, do not wrestle the solver — decide between a fork and the View::composer('*') fallback described below.BeyondCode\ViewXray\ViewXrayServiceProvider, so there is usually no config/app.php edit. Confirm it loaded via php artisan about or by checking bootstrap/cache/packages.php.php artisan vendor:publish --provider="BeyondCode\ViewXray\ViewXrayServiceProvider"
Inspect config/view-xray.php, then set VIEW_XRAY_ENABLED=true in your local .env only. Never put it in a shared .env.example.php artisan config:clear && php artisan view:clear
@include/<x-...> tree — a layout plus several partials — where the mapping is genuinely unclear. That is the moment the tool earns its keep; the simplest pages tell you nothing new.resources/views and is the single most common day-to-day use.@extends/@section/@include chains.@include into an anonymous component, confirm the same file is still rendering the same region. Attribution that changes shape between the two states is a fast signal you moved a boundary.code -g for VS Code, phpstorm URL scheme, etc.) so a click opens the file. This is the difference between a nice overlay and a real time saver — get it right on day one.Content-Length, CSP-restricted pages, or anything a later middleware replaces. If you see nothing, suspect your middleware stack and security headers before blaming the package.view:clear before trusting a line reference, especially after structural refactors.VIEW_XRAY_ENABLED or editing the config without config:clear leaves you debugging a setting you never applied. Same for view:cache in local workflows.local, avoid shared staging, and confirm .env values are not committed or inherited.View::composer('*', function ($view) {
logger()->debug('view', ['name' => $view->getName(), 'path' => $view->getPath()]);
});
This is your exit ramp — keep it in the README so nobody is blocked when the package breaks.How can I help you explore Laravel packages today?