Published - 6 years ago ( Updated - 6 years ago )
Laravel 5.7.x, the artisan command starts to support and integrate Symfony's dump-server.
Through the artisan command, start the dump-server, and we can display the dump data on the console.
So let me use D-Laravel, give it a try.
First, simply use D-Laravel's bash (./create test10) to create a new Laravel Project,
Check whether the version is above Laravel 5.7.x by alias ( a --version ).
Here, a in the figure below is the alias of php artisan of Laravel.
If you don't know the a alias setting of D-Laravel, please refer to this.
Through the artisan command, start the dump-server, and we can display the dump data on the console.
php artisan dump-server
Or, transfer the dumped data into html format.
php artisan dump-server --format=html > dump.html
So let me use D-Laravel, give it a try.
First, simply use D-Laravel's bash (./create test10) to create a new Laravel Project,
Check whether the version is above Laravel 5.7.x by alias ( a --version ).
Here, a in the figure below is the alias of php artisan of Laravel.
If you don't know the a alias setting of D-Laravel, please refer to this.
OK, then start dump-server, enter a dump-server.
Because it is just a simple test, I directly modify the welcome.blade.php file, the content is as follows:
In the code below, I want to use the dump() function to print out $ test variable, to the console terminal.
@php
$test="TEST";
#Measurement dump-server prints data
dump($test);
@endphp
Test dump-server and
dump(); function
Load the page and see if anything gets dumped.
In the browsing screen above, we can see that once the dump-server is started, the dumped data will not be displayed in the browser,
Instead, the TEST variable is dumped from terminal.
Cool!!
No Comment
Post your comment