当前位置:网站首页>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
边栏推荐
- 《厌女:日本的女性嫌恶》摘录
- [1] Basic knowledge of ros2 - summary version of operation commands
- Shell batch file name (excluding extension) lowercase to uppercase
- Distributed transaction solution
- Centso7 OpenSSL error Verify return code: 20 (unable to get local issuer certificate)
- PC端页面如何调用QQ进行在线聊天?
- Esp32 construction engineering add components
- 如何让join跑得更快?
- Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
- Write it down once Net a new energy system thread surge analysis
猜你喜欢
Navicat run SQL file import data incomplete or import failed
Getting started with MySQL
AI人才培育新思路,这场直播有你关心的
供应链供需预估-[时间序列]
. Net core about redis pipeline and transactions
JS slow motion animation principle teaching (super detail)
Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)
1. Deep copy 2. Call apply bind 3. For of in differences
2022-7-6 beginner redis (I) download, install and run redis under Linux
2022-7-6 sigurg is used to receive external data. I don't know why it can't be printed out
随机推荐
Introduction and basic use of stored procedures
MySQL error 28 and solution
Centso7 OpenSSL error Verify return code: 20 (unable to get local issuer certificate)
C语言数组相关问题深度理解
Xshell connection server changes key login to password login
室内ROS机器人导航调试记录(膨胀半径的选取经验)
ES日志报错赏析-Limit of total fields
PHP - laravel cache
Cmake learning and use notes (1)
Build a secure and trusted computing platform based on Kunpeng's native security
Write it down once Net a new energy system thread surge analysis
postgresql array类型,每一项拼接
如何让join跑得更快?
数据库系统概论-第一章绪论【概念模型、层次模型和三级模式(外模式、模式、内模式)】
作战图鉴:12大场景详述容器安全建设要求
云计算安全扩展要求关注的安全目标和实现方式区分原则有哪些?
内存溢出和内存泄漏的区别
2022-7-6 Leetcode 977. Square of ordered array
Learning breakout 2 - about effective learning methods
Split screen bug notes