Laravel5 framework learning environment and configuration. Laravel5 framework learning environment and configuration. the env file is the configuration file, including database configuration information, view config-database.php, connections contains the Laravel 5 framework learning environment and configuration, laravel5 framework environment
The. env file is a configuration file, including the database configuration information. View config-> database. php. connections contains the configuration of all databases. you can select the database to use in default. In database configuration, env ('Db _ host', 'localhost') is used to read the. env configuration file. The second parameter is the default parameter.
We use the mysql database to modify. env:
DB_HOST=localhostDB_DATABASE=laravelDB_USERNAME=rootDB_PASSWORD=
Create a laravel database in mysql
mysql -u root CREATE DATABASE laravel
View mysql configuration:
'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, ],
The config subdirectory contains all the configuration files.
The above is all the content of this article, hoping to help you learn the Laravel5 framework.
Http://www.bkjia.com/PHPjc/980215.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/980215.htmlTechArticleLaravel 5 framework learning environment and configuration, laravel5 framework environment. env file is the configuration file, including the database configuration information, view the config-database.php, connections contains...