Laravel separates application configuration from environment-specific values.
Environment variables can include:
APP_ENV
APP_KEY
DB_HOST
DB_DATABASE
DB_USERNAME
DB_PASSWORD
CACHE_STORE
Configuration files access environment values and application code should generally read configuration through the config system.
Example:
config('app.name')
Scenario:
Development may use a local MySQL database while production uses a managed database service. The application code should not contain production credentials.
Important interview point:
Do not commit secrets to source control. Production configuration should be managed through an appropriate deployment/secrets process.
0 comments:
Post a Comment
Thanks