by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

Foreword:

In the directive of Laravel 5.6.8, there is a new function called @dump
Let's see how cool he is.

Regarding the update:

Before starting, let me briefly describe my update experience this time. My last version was Laravel 5.5.33 (the version before the update).
In this update, I directly modified my composer.json to use the new version of Laravel,
Then update him directly.


After adjusting require, execute it directly for him
composer update

After updating, execute php artisan (alias) to view the version. Update 5.5.33 to 5.6.11 ..:)


The update went smoothly and executed without issue, luckily .

The above is my update experience, if you want to update like this, please be sure to test whether it is feasible in the development environment first!!

Or suggest reading the upgrade manual.
https://laravel.com/docs/5.6/upgrade


topic

Closer to home, let's take a look at the new feature @dump of the blade on 5.6 that I updated.
Here, I spit out an Array $abc from the Controller to the view for testing.

Display the results through var_dump and @dump respectively:


In the above picture, you can see that @dump super easy to use, and it can also be collapsed : (as shown below)

Cool..I like it.

 

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

How do I upgrade the backend to Lravel 5.5

At the beginning, my background was a framework created by myself, which also uses MVC architecture, database connections and environment configuration files made by myself, including my own template syntax, until I want to support Restful, I have an idea, why should I rewrite the same function myself after others have written it, would it be better to write it out? So I started to use the framework, At the beginning, Slim was adopted mainly because it supports a lower version of php, but because Slim's twig templates are not as easy to use as Laravel's blade template...

laravel,oauth2

My most used Laravel passport directives

Laravel provides quite a lot of useful packages, such as Passport is one of them, when the website needs to set up its own OAuth2 authentication host, it really saves time and effort. Take this site as an example, because the front-end and back-end separation mechanisms are adopted (there are two different Laravel projects), and I verify them through the front-end WEB. Basically, I have many other different projects, and they all rely on OAuth2 provided by Laravel to handle cross-domain authentication.

docker,laravel

How to use multiple YAML files to execute multiple docker container services

This video introduces how to use the docker-compose command to specify multiple YAML structure language configuration files to create container execution, and introduces how we simplify docker-compose by using .env in the D-Laravel environment Start command.