ConfigurationLearn how to configure your Dracory application for different environments. ConfigurationAll of the configuration files for the Dracory framework are stored in the config directory. Each option is documented, so feel free to look through the files and get familiar with the options available to you. Environment ConfigurationIt is often helpful to have different configuration values based on the environment where the application is running. For example, you may wish to use a different database locally than you do on your production server. To make this a cinch, Dracory utilizes the .env file. A .env.example file is included with the framework, which contains common environment variables. During the Dracory installation process, this file will automatically be copied to .env. You should typically run the config:cache command as part of your production deployment routine. The command should not be run during local development as configuration options will frequently need to be changed during the course of your application's development.
Configuration FilesDracory's configuration files are located in the config directory. These files allow you to configure things like your database connection information, mail server information, as well as various other core configuration values such as your application timezone and encryption key. App ConfigurationThe config/app.go file contains several options such as the application name and timezone.
Database ConfigurationThe config/database.go file contains configuration for your database connections, and supports several database systems out of the box, including MySQL, PostgreSQL, and SQLite.
Accessing Configuration ValuesYou can easily access configuration values within your application using the config package:
Configuration CachingTo give your application a speed boost, you can cache all of your configuration files into a single file using the config:cache command:
You should typically run the config:cache command as part of your production deployment routine. The command should not be run during local development as configuration options will frequently need to be changed during the course of your application's development. |