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,blade

Laravel 5.5 make:model's -a parameter and Blade version chunk function introduction

Do you not know what the make:model -a parameter is? This video will briefly introduce the actual operation process. And use the chunk function in the Blade set to end.

dlaravel

How to start supervisor on D-Laravel

Since queue workers are a long-running program, we need a program manager supervisor to monitor whether the process on the Linux system is running continuously. For example, when the queue:work operation fails, the queue:work process can be automatically restarted. Fortunately, D-Laravel has a built-in supervisor, so you don't need to install it yourself to use it. This article briefly introduces how we start the supervisor in the container.

laravel,dotenv,seo

How do I dynamically load different dotenv files in Laravel according to the subdomain name

Before we start, let me complain. Originally, my website could automatically display different languages ​​according to the user's browser. That's okay, but Google's SEO doesn't seem to like it. He recommends using different URLs for each language and not using cookies or browser settings to adjust the content of the page. Well, I'll just be obedient. His suggested method, the first solution: distinguish by country, such as example.tw or example.de, how is this really impossible, or buy the registered domain name, or take all the domain names and no one will take it The strange domain name is more likely. The second solution: use sub-domain names to distinguish, this is what I am going to do, and so on to explain how to do it in Laravel. The third solution: example.com/tw/ and the like, Apple seems to do it this way. The fourth solution: site.com?loc=tw and the like are not recommended, indeed I think this is not a good idea.