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. 😉