当前位置:网站首页>Environment configuration of lavarel env
Environment configuration of lavarel env
2022-07-07 13:51:00 【Full stack programmer webmaster】
.env The file is located in the root directory of the project , As a global environment configuration file .
1. Configuration parameters
// Running environment name APP_ENV=local // Debug mode , Development phase enabled , Online status is disabled . APP_DEBUG=true // Sensitive information encryption key , You can use php artisan key:generate To regenerate the . APP_KEY= // Project root APP_URL=http://localhost // Cache drive , File is used as cache by default . CACHE_DRIVER=file // Call back drive , Use file storage by default SESSION. SESSION_DRIVER=file // Queue driven , Synchronous mode is used by default . QUEUE_DRIVER=sync // Redis High performance key-value database , Use memory storage , For data persistence . REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 // Database configuration items DB_HOST=127.0.0.1// Database host name DB_PORT=3306// Database port DB_DATABASE=homestead// Database name DB_USERNAME=homestead// Database login account DB_PASSWORD=secret// Database login password
[ doubt ].env
How does the environment configuration work in the project ? .env
The document is actually right /config/
Extract the general configuration under the directory . see /config/app.php
Can be found , The system provides env()
For reading .env
File configuration .
[ doubt ].env
The database configuration of does not have the setting of data table prefix , What to do ? see /config/database.php
Provided in the document prefix
Fields can be modified , Can be in .env
Add... To the file DB_PREFIX
To configure , And in /config/database.php
modify prefix
The options are env(DB_PREFIX,'')
.
2. Get configuration
env() Use env()
Available .env
Global general configuration in the file . for example :env('DB_HOST')
config() Use config()
Available /config/
Configuration item information of items under the directory . for example :config('database.connections.mysql.prefix')
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/113301.html Link to the original text :https://javaforall.cn
边栏推荐
- Digital IC Design SPI
- DID登陆-MetaMask
- Error lnk2019: unresolved external symbol
- Problems that cannot be accessed in MySQL LAN
- SSRF漏洞file伪协议之[网鼎杯 2018]Fakebook1
- 2022-7-7 Leetcode 844. Compare strings with backspace
- Ogre introduction
- High end for 8 years, how is Yadi now?
- What are the principles for distinguishing the security objectives and implementation methods that cloud computing security expansion requires to focus on?
- Distributed transaction solution
猜你喜欢
Write it down once Net a new energy system thread surge analysis
How far can it go to adopt a cow by selling the concept to the market?
Build a secure and trusted computing platform based on Kunpeng's native security
Distributed transaction solution
Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf
Error lnk2019: unresolved external symbol
QQ medicine, Tencent ticket
Ways to improve the performance of raspberry pie
带你掌握三层架构(建议收藏)
干货|总结那些漏洞工具的联动使用
随机推荐
Read PG in data warehouse in one article_ stat
QQ medicine, Tencent ticket
Mathématiques avancées - - chapitre 8 différenciation des fonctions multivariables 1
PHP中用下划线开头的变量含义
Build a secure and trusted computing platform based on Kunpeng's native security
Laravel Form-builder使用
Data refresh of recyclerview
Split screen bug notes
Laravel5 call to undefined function openssl cipher iv length() 报错 PHP7开启OpenSSL扩展失败
ROS机器人更换新雷达需要重新配置哪些参数
JS function returns multiple values
The delivery efficiency is increased by 52 times, and the operation efficiency is increased by 10 times. See the compilation of practical cases of financial cloud native technology (with download)
LeetCode简单题分享(20)
Indoor ROS robot navigation commissioning record (experience in selecting expansion radius)
高等數學---第八章多元函數微分學1
move base参数解析及经验总结
Ways to improve the performance of raspberry pie
为租客提供帮助
最佳实践 | 用腾讯云AI意愿核身为电话合规保驾护航
[high frequency interview questions] difficulty 2.5/5, simple combination of DFS trie template level application questions