Environment Variables
Laravel applications use .env
file or an environment configuration to store and manage essential and usually unchanging settings such as database server credentials and mail provider. This elliminates the inconvenience of having to change the configuration file directly which may break future updates.
Populate the .env
file at the root of the application folder with your server's configuration. Below is a snippet of the default configuration. The variables are explained in the succeeding sections.
Application
Variable
Default
Description
APP_NAME
CPDTrack
Application name, contain inside quotation marks if exceeds two words
APP_ENV
production
Environment setting
APP_DEBUG
false
Enable debugging
APP_URL
Base URL of your application
For production, it is recommended that APP_ENV
and APP_DEBUG
be left as default as it may expose confidential information and compromise the application.
Database
Consult with your database administrator for the following credentials.
Variable
Default
Description
DB_DATABASE
cpdtrack
Database name
DB_USERNAME
root
Database username
DB_PASSWORD
Database password
DB_PORT
3306
Database server port
The application's database structure is created with MySQL and therefore uses features that are native to MySQL and MariaDB alone.
Mail
The application uses emails to send notifications and therefore required a working mail server.
Variable
Default
MAIL_DRIVER
smtp
MAIL_HOST
smtp.mailtrap.io
MAIL_PORT
2525
MAIL_USERNAME
secret
MAIL_PASSWORD
secret
MAIL_ENCRYPTION
tls
Last updated