by Devin Yang
(This article was automatically translated.)

Published - 5 years ago ( Updated - 5 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


dlaravel

How to set the external network IP to the Project on D-Laravel?

This video introduces how we assign Public Ip (public IP) to a specific Project in the D-Laravel environment. Whether it is the setting of the external production environment or the demo of your own project on the intranet, you can refer to the setting method of this video. In the video, although I used the external network IP of PPPoE dial-up to illustrate, we can also use the local network IP on our own computer if we change it. In this way, colleagues can connect to our D-Laravel Project.

dlaravel

D-Laravel's sublime plug-in can be installed by Package Control.

Mac or Linux users can now install the D-Laravel alias package from Sublime3's package control. Through D-Laravel alias, we can execute artisan and composer commands in the container in an easier way. In the docker environment, do you want to use composer to install the package? You don’t need to enter the container, or set the ce alias of composer, and you can execute it directly in sublime.

dlaravel

D-Laravel test domain name *.dev changed to *.test

Since Google Chrome 63 will forcibly convert the domain name of *.dev to https, the domain name of the new version of D-Laravel will be changed to *.test. This article explains how to update.