当前位置:网站首页>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
边栏推荐
- Enregistrement de la navigation et de la mise en service du robot ROS intérieur (expérience de sélection du rayon de dilatation)
- 如何让join跑得更快?
- 1、深拷贝 2、call apply bind 3、for of for in 区别
- mysql 局域网内访问不到的问题
- Redis只能做缓存?太out了!
- 交付效率提升52倍,运营效率提升10倍,看《金融云原生技术实践案例汇编》(附下载)
- Shell batch file name (excluding extension) lowercase to uppercase
- Centso7 OpenSSL error Verify return code: 20 (unable to get local issuer certificate)
- C语言数组相关问题深度理解
- 2022-7-6 初学redis(一)在 Linux 下下载安装并运行 redis
猜你喜欢
Xshell connection server changes key login to password login
Error lnk2019: unresolved external symbol
118. 杨辉三角
Navicat run SQL file import data incomplete or import failed
Custom thread pool rejection policy
Thread pool reject policy best practices
提升树莓派性能的方法
为租客提供帮助
Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
如何让join跑得更快?
随机推荐
User management summary of mongodb
Detr introduction
Realize the IP address home display function and number home query
xshell连接服务器把密钥登陆改为密码登陆
call undefined function openssl_cipher_iv_length
[1] ROS2基础知识-操作命令总结版
PostgreSQL array type, each splice
ROS机器人更换新雷达需要重新配置哪些参数
Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
QQ medicine, Tencent ticket
LeetCode_二分搜索_中等_153.寻找旋转排序数组中的最小值
《厌女:日本的女性嫌恶》摘录
flask session伪造之hctf admin
What are the principles for distinguishing the security objectives and implementation methods that cloud computing security expansion requires to focus on?
带你掌握三层架构(建议收藏)
Evolution of customer service hotline of dewu
clion mingw64中文乱码
DID登陆-MetaMask
1、深拷贝 2、call apply bind 3、for of for in 区别
C语言数组相关问题深度理解