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

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

After upgrading Laravel 8.8, I integrated the articles and notes together

Laravel 8 has undergone major revisions, and my website has also been revised accordingly. The "notes" and "articles" on my website were originally separated into two blocks. This time I integrated him together. Anyway, there are not many articles, and the combined content seems to be more. :p