Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Take a look into your Laravel views

License

NotificationsYou must be signed in to change notification settings

beyondcode/laravel-view-xray

Repository files navigation

Latest Version on PackagistBuild StatusQuality ScoreTotal Downloads

When your Laravel project grows, so do the Laravel views. Sometimes it might be hard to figure out, which part of the output HTML was rendered using which template.With this package, you can take a peek into your Laravel views and find out which template is responsible for which part of the output HTML.

Example output

Installation

You can install the package via composer:

composer require beyondcode/laravel-view-xray --dev

The package is enabled by default - so all you need to do is visit your application in the browser and hit the Xray shortcut.

  • Windows: CTRL + Shift + X
  • OSX: CMD + Shift + X

This toggles the Xray view, where you can see which view (and optionally section) rendered the visual output.

Disabling Xray

You can disable Xray by setting an environment variable calledXRAY_ENABLED tofalse.

Excluding views

If you want to exclude certain views from being processed by Xray, you can do this by adding them to the configuration file.

Publish the configuration file using:

php artisan vendor:publish --provider=BeyondCode\\ViewXray\\ViewXrayServiceProvider

This will publish a file calledxray.php in yourconfig folder.

This is the content of the configuration file:

<?phpreturn [/*     * Determines if the Xray package should be enabled.     */'enabled' =>env('XRAY_ENABLED',true),/*     * If you want to exclude certain views from being processed by Xray,     * you can list them here. Be aware that the check only applies to the     * root views that you add here. If these views include other views     * themselves, they need to be excluded manually.     */'excluded' => [//    ],];

Just place the view names that you want to exclude in theexcluded array.

FAQ

  • Does this work with VueJS too?

Yes, this package does work in combination with VueJS, but you need to enable comments in your VueJS app. This package works by adding specific HTML comments into the rendered views and usesthese comments to find the bounding boxes of the rendered HTML. VueJS by default removes HTML comments prior to rendering.

You can enable HTML comments in your VueJS app by settingcomments totrue:

letapp=newVue({el:'#content',comments:true});

Testing

composertest

Changelog

Please seeCHANGELOG for more information what has changed recently.

Contributing

Please seeCONTRIBUTING for details.

Security

If you discover any security related issues, please emailmarcel@beyondco.de instead of using the issue tracker.

Credits

This project is inspired byxray-rails.

License

The MIT License (MIT). Please seeLicense File for more information.

About

Take a look into your Laravel views

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp