by Devin Yang
(This article was automatically translated.)

Published - 1 year ago ( Updated - 1 year ago )

This article uses Laravel 9.40.1 for operation. I believe many people know the usage of --env, but I still provide some information for Laravel beginners.
In the artisan command, we can use --env to specify different .env files, so that under different subdomains, I can use different environments or even different databases.
You should have also noticed that this site uses a multilingual environment, do you write two sets?
Of course not, basically I built multiple .env in the same Project.

So when I use tinker, which one should I connect? Just use the --env specification to see the picture directly 🙂


As an aside, tinker can be used directly in the screen because aliases are set in the default environment of phpenv.
The alias of phpenv is set as follows:

alias tinker='/usr/local/bin/php /var/www/html/artisan tinker'

What is the advantage of such an absolute path? He means that no matter where your path is, he can execute normally. 😉

Tags: Laravel artisan

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.

nginx,dlaravel

How to configure HTTPS on nginx to get an SSL A+ score from Qualys

This article describes how to adjust the ssl settings of nginx so that the website can obtain an SSL report and get an A+ rating. Here I am using letsencrypt free credentials. As long as you use the official Docker nginx new version image preset by D-Laravel, you should be able to achieve the same effect as mine. You can check your host SSL settings through the following. https://www.ssllabs.com/ssltest/index.html

dlaravel

Super easy to use HTML to PDF kit mpdf introduction

During development, will it be necessary to output HTML to PDF? This video introduces how to output PDF on the screen through the mpdf library of php.