in Education by
I have 2 buckets prod and dev. Inside .env I have S3_PROD and S3_DEV. I want my system to point to S3_DEV when I am in my dev environment. Taking consideration that I could have 10 variables to be pointed to a specific endpoint based on our environment what should be the best approach to set that? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You're .env file should not be tracked by whatever deployment/versioning system you have. Ideally your dev environment file would contain the keys appropriate and in your config you would simply call env('S3_REGION') for example. But for the sake of bad ideas lets say you have almost identical .env files in your dev environment and your production, change the APP_ENV=local to dev or prod and then an if statement in your config. I would highly recommend you follow the documentation on this. Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration. Furthermore, this would be a security risk in the event an intruder gains access to your source control repository, since any sensitive credentials would get exposed. If you are developing with a team, you may wish to continue including a .env.example file with your application. By putting placeholder values in the example configuration file, other developers on your team can clearly see which environment variables are needed to run your application. You may also create a .env.testing file. This file will override the .env file when running PHPUnit tests or executing Artisan commands with the --env=testing option.

Related questions

0 votes
    I have 2 buckets prod and dev. Inside .env I have S3_PROD and S3_DEV. I want my system to point ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    When I have started with the project using Laravel 5.7 and PHP 7.3, $info->id returned correctly the last insert id. Now, I did ... :1 [ 0 => "*" ] } This is my GfTableModel.php:...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    When I have started with the project using Laravel 5.7 and PHP 7.3, $info->id returned correctly the last insert id. Now, I did ... :1 [ 0 => "*" ] } This is my GfTableModel.php:...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    The study of people, their physical characteristics and the way in which they function in relation to their working ... None of these Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    Question No.1: What do you understand about container tag and empty tag, give example? Question No.2: What do ... all the attributes? Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    7-RAM contains BIOS of system – (2 POINT) 1 TRUE 2 OTHER Select the correct answer from above options...
asked Dec 29, 2021 in Education by JackTerrance
0 votes
    A clock is started at noon. By 10 minutes past 5, the hour hand has turned through: A) 145 B) 150 C) 155 D) 160...
asked Feb 13, 2021 in Education by JackTerrance
0 votes
0 votes
    Find the probability that when a hand of 7 cards is drawn from a well shuffled deck of 52 cards, it contains ... iii) atleast 3 Kings. Select the correct answer from above options...
asked Nov 15, 2021 in Education by JackTerrance
0 votes
0 votes
    Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Which event is called once notification system is initialized? a)notification b)register c)registration d)started...
asked Apr 28, 2021 in Technology by JackTerrance
0 votes
    I am working on a project that requires a secure connection. I can set the route, uri, asset to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    Default Environment Variables by Jenkins & How to introduce custom environment variables?...
asked Sep 14, 2021 in Technology by JackTerrance
...