by Devin Yang
(This article was automatically translated.)

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.
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!!

Tags: laravel

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


laravel,docker

How to customize Laravel pagination

Recently, I have been free, and I want to adjust the arrows on the upper and lower pages of the website. If you don’t know how to customize Laravel’s pagination, You can take a look at a short three-minute introduction on how I customize Laravel's pagination.

laravel

Add fields and update Laravel at the same time

I was told by my friends, Murphy's Law, that promotion is always so difficult, of course I have to show him how smooth I am, I'm not afraid. I also added a column by the way.