Reference phphub:laravel Another debugging tool Anbu, inside the installation of less than one step did not write, reference Github:https://github.com/daylerees/anbu
Installation:
composer.json
Add in the require
field"daylerees/anbu": "dev-master"
" require " : { "laravel/framework""4.2.*", " Daylerees/anbu " " Dev-master " }
Performcomposer update
Then add the corresponding config/app.php in theServiceProvider
Array ( ... ') Illuminate\view\viewserviceprovider ', ' Illuminate\workbench\workbenchserviceprovider ', ' Anbu\ Profilerserviceprovider ',),
Add Anbu facade to the alias array
Array ( ... ') Anbu ' = ' Anbu\facades\anbu ')
Publish a profiling resource file (publish Profiler asset files):php artisan asset:publish
At the same time, the corresponding database connection should be configured because Anbu introduces a table for storing related information.
Use:
In order to better see the relevant features, in the route.php
file, we add the following test code:
//route.phpRoute:: Get ('/',function(){ //Debug, when you are dd()
risk exposing information to the users of your application. Instead, use-to-dump this data into the ad()
' Debug ' section of Anbu. AD (' foo '); AD (' 3 '); AD (' 30.33 '); AD (with (NewStdClass)->foo = ' Bar '); AD ([' Name ' = ' Zhangsan ', ' age ' = 14]); //timers, the facade added in app.php is prepared for this, and other places are useless to the Anbu class. Anbu::timers ()->start (' Test ')); Sleep(1);//Do something interesting.Anbu::timers ()End(' Test ', ' completed doing something. ')); //DB Query\db::table (' Anbu ')get (); //Log Entries\Log:: info (' info message ')); \Log:: Info (' another message ')); \Log:: Error (' Wrong message '); returnView::make (' Hello ');}); Route::p ost ('/foo/baz/boo ', ' anbu\\controller\[email protected] '); Route::p atch ('/foo/bar ', ' anbu\\controller\[email protected] '); Route::p ut ('/foo/bar ', ' anbu\\controller\[email protected] '); Route::d elete ('/foo ', ' anbu\\controller\[email protected] ');
Hide and disable:
First let me explain the concepts.
To hide was to eliminate the Laravel icon button from requests, so it won ' t interfere with certain content Ty Pes.
To disable are to stop the profiler from storing the request, and displaying the button. Data for this request would be lost.
You can hide the profiler using:
Anbu::hide();
Or you can apply the anbu.hide
filter as a before
filter to any route or route group.
You can disable the profiler using:
Anbu::disable();
Or you can apply the anbu.disable
filter as a before
filter to any route or route group.
Problem solving:
If A new module is added and then you might get an error when rendering a previous request.
Here's some things you can try if you had any problems. First can try updating Anbu with:
composer update
Secondly you can clear the previous requests with the following Artisan command.
php artisan anbu:clear
Laravel Debugging Tools Anbu Use