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 linux

My mobile computer, install Laravel 8 on Sony xperia 5 II

This is my first Android phone. It's no problem to try to install Laravel. Basically, I installed vim and mariadb. After executing sshd, you can log in through 8022, it is completely a mobile computer: p. The software I use is Termux...


Safe Update D-Laravel

How to upgrade the current D-Laravel. If your current use environment is very smooth and you have not encountered any problems, you don't need to update it. If you want to use the latest version, and bug fixes, etc., please read this article carefully, In order to ensure a smooth upgrade, the following is the recommended way to upgrade D-Laravel.


Zhibang installs Laravel 5.4 experience sharing

Install Laravel 5.4 on Zhibang's Linux 7.0 platform, and successfully execute the case sharing, Because it was originally an old version of PHP, it can be transferred to the new version for free for the first time, So please ask them to open a test php 7.0 environment for us to test, after small adjustments, Laravel's environment can indeed be executed on Accton's managed host. This article introduces how I successfully implemented Laravel's website process in Zhibang.