当前位置:网站首页>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
边栏推荐
- 室內ROS機器人導航調試記錄(膨脹半徑的選取經驗)
- [daily training -- Tencent select 50] 231 Power of 2
- LED light of single chip microcomputer learning notes
- Solve the cache breakdown problem
- TPG x AIDU | AI leading talent recruitment plan in progress!
- Error lnk2019: unresolved external symbol
- 2022-7-6 Leetcode27. Remove the element - I haven't done the problem for a long time. It's such an embarrassing day for double pointers
- Write it down once Net a new energy system thread surge analysis
- Flink | 多流转换
- 2022-7-6 Leetcode27.移除元素——太久没有做题了,为双指针如此狼狈的一天
猜你喜欢

2022-7-6 Leetcode 977.有序数组的平方

Getting started with cinnamon applet

2022-7-7 Leetcode 844. Compare strings with backspace

DID登陆-MetaMask

【堡垒机】云堡垒机和普通堡垒机的区别是什么?

LIS longest ascending subsequence problem (dynamic programming, greed + dichotomy)

室內ROS機器人導航調試記錄(膨脹半徑的選取經驗)

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)

Digital IC Design SPI

. Net core about redis pipeline and transactions
随机推荐
Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf
最佳实践 | 用腾讯云AI意愿核身为电话合规保驾护航
requires php ~7.1 -> your PHP version (7.0.18) does not satisfy that requirement
Final review notes of single chip microcomputer principle
Digital IC Design SPI
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
云计算安全扩展要求关注的安全目标和实现方式区分原则有哪些?
TPG x AIDU | AI leading talent recruitment plan in progress!
供应链供需预估-[时间序列]
Move base parameter analysis and experience summary
Deep understanding of array related problems in C language
mysql ”Invalid use of null value“ 解决方法
Esp32 ① compilation environment
带你掌握三层架构(建议收藏)
THINKPHP框架的优秀开源系统推荐
Esp32 series column
社会责任·价值共创,中关村网络安全与信息化产业联盟对话网信企业家海泰方圆董事长姜海舟先生
LeetCode_ Binary search_ Medium_ 153. Find the minimum value in the rotation sort array
Esp32 construction engineering add components
室內ROS機器人導航調試記錄(膨脹半徑的選取經驗)