Pretty much everything is clearly explained here.
But lets take a look some pointers, that should be pulled up, to let see things clearer.
You must remember to setup DATABASE access data in .env file.
For code completion you may use this file. Place it in Laravel app root folder, Do not push it to repository!
.env (in main catalog) file overrides information stored in your config files (folder: /config).
It is great for development purposes – just make sure you will not upload it to repo, or download any from repo (e.g. put there by some team member by mistake).
If you get this error in CLI:
SQLSTATE[HY000]  Access denied for user 'homestead'@'localhost' (using password: YES)
… you forgot to edit your Database credentials in your .env file.
- all config files are stored in /config dir
- accessing config value anywhere within Laravel powered app:
PHP123$value = config('app.timezone');
‘app‘ is a config file name, and
‘timezone‘ in config value
- setting config values at runtime (not in config file, but ad hoc):
PHP123config(['app.timezone' => 'America/Chicago'])
- .env: startup configuration values (environment configuration)
all .env values are loaded to PHP superglobal $_ENV
env helper function is used to load to $_ENV, e.g. see config files
env helper is used with default value, in case .env file does not have one, e.g.:
value in .env file overrides helper function default file (false in given example)
do not push to remository .env file, as your local devel configuration on .env may not suit online project
- configuration files catching:
should be done for production ready version
should NOT be used during development routine
code (in terminal):
PHP123php artisan config:cache
If you want to put your site in a stand-by, use this code:
php artisan down
If you want it live again, use this code:
php artisan up