-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Make app name configurable in environment file #4204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make app name configurable in environment file #4204
Conversation
I do indeed find myself writing this manually into almost every project I write as well. +1 |
I tought laravel's .env file is designated for a credentials and sensitive information only while the config file is used for a usual needs where you can change app's name and similiar data. |
@danieltorscho is correct. You are meant to edit the config files in apps. However, this PR is sent more than once a month, so I suspect is was merged to stop yet more PRs. |
@GrahamCampbell @danieltorscho This could be useful when you want to have different title for the staging\dev application for example. |
@GrahamCampbell If the This PR isn't about not wanting to edit config files in apps - of course you're supposed to do that for the things that are consistent between every deployment / environment of your app - but there are situations where you want a different app name in different environments to make identification easier. Mailables, for example, use the app name by default, and knowing that I have a contact message from my staging area and not the production server can be quite useful. If this PR has been sent more than once a month, that's a clear indication that there's a need for this, which I suspect is why it was merged, rather than it being just to stop more PRs of the same nature. /cc @danieltorscho @a-komarev @m1guelpf @DojoGeekRA |
@GrahamCampbell sorry bro, I have to sit with @mdavis1982 on this one.
As far as examples go for this being an exactly acceptable use-case for 💓 |
The file is for environment specific things, by definition. It is not exclusively for credentials, but also for things that vary per environment, such as choosing drivers. It is not for things that are fixed per application, and is commonly abused for this. |
I actually think it would be a pretty cool idea to introduce a |
@GrahamCampbell that's exactly what I said 😄 However, you did say that @danieltorscho was correct in saying that this file was designated for credentials and sensitive information only, which isn't the case. This isn't an abuse of the With regards to the |
Separating |
I get all points around, but it's not hard to add I don't use |
@joshmanders I'm 100% willing to bet that more people change their app name than people use Heroku. That said, no you shouldn't. Don't be pedantic for the simple reason of being pedantic. |
@ConnorVG all I am saying is, if you change your app name every 3 minutes, then make the configuration changes yourself. Flooding the .env file with cruft that the majority of people don't use is annoying. |
This PR makes the application name configurable via an environment variable. By default, this is set to "Laravel" as per the current configuration in the
app.php
config file.Why?
When developing applications with Laravel, I am often putting a version onto a staging server as well as a production server. By making the app name configurable, when I get
Mailables
sent to me (which, by default use the app name) I can see more easily whether the e-mail has come from the staging server or the production server.It can also make it easier to identify which version of an application is being viewed in a browser (for example configuring the local development version with
Local
at the end can avoid mistakes when there are multiple tabs open with local, staging and production versions of the application.