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.

laravel,woops

Laravel 5.5 Woops is back, let's check it out.

Woops is a framework for PHP error handling. It was preloaded in Laravel 4, but it was removed in Laravel 5.0, and now 5.5 is back.... Some features of Whoops include: - Flexible, stack-based error handling - No dependencies are required to use the current stand-alone library - Simple API for handling exceptions, tracking frames and their data -Include a stunning error page within your web application - Includes the ability to open referenced files directly in editors and IDEs - Includes handlers for different response formats (JSON, XML, SOAP) -Easy to extend and integrate with existing libraries - Clean, well structured and proven generation

dlaravel

How to directly execute the php artisan of different projects in the container on the host.

This article is the application teaching of D-Laravel, how to directly execute php artisan in the container on the host side. After customizing the alias, you can directly execute php artisan in the contianer in the project folder on the host side. alias a="../../artisan.sh"