Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to connect to Laravel Debug bar

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about how to connect to Laravel Debug bar. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

I. brief introduction

Laravel Debugbar integrates PHP Debug Bar in Laravel 5 to display debug and error messages to facilitate development. The expansion pack includes a ServiceProvider for registering debug bars and displaying data collections during development, you can publish front-end resources and configurations, and you can configure display redirects and Ajax requests.

The expansion pack contains the following custom collectors:

QueryCollector: show all queries, including bindings and time RouteCollector: show current routing information ViewCollector: show currently loaded view (optional: show shared data) EventsCollector: show all events LaravelCollector: show Laravel version and environment SymfonyRequestCollector: replace RequestCollector, display more information about requests / responses LogsCollector: display the latest log entries from log files FilesCollector: display PHP include/require files ConfigCollector: display configuration values for configuration files

Collectors included when Laravel starts:

LogCollector: displays the SwiftMailCollector and SwiftLogCollector provided for messages with all log information

And the following default collectors:

PhpInfoCollectorMessageCollectorTimeDataCollector (including startup and application time) MemoryCollectorExceptionsCollector

In addition, a facade is provided for recording messages, times, and exceptions.

Tip: this Laravel Debugbar can only be used in the development process, and the use of this expansion package has an impact on performance (there is system overhead in collecting and aggregating data). So please turn off debug bar before launching the project.

Second, install debug bar

Install the expansion pack using Composer:

Composer require barryvdh/laravel-debugbar

After the installation is complete, register the service provider with the providers array in config/app.php.

Barryvdh\ Debugbar\ ServiceProvider::class

Add to the aliases array in the configuration file config/app.php:

'Debugbar' = > Barryvdh\ Debugbar\ Facade::class

Then run the following Artisan command to copy the configuration file of the expansion pack to the config directory:

Php artisan vendor:publish

If debug is set to true in the configuration file, the Debugbar parser is enabled by default. If you want to close the parser, set enabled to false in the configuration file config/debugbar.php.

The above is the editor for you to share how to connect Laravel Debug bar, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report