当前位置:网站首页>Laravel 中config的用法
Laravel 中config的用法
2022-07-07 14:06:00 【全栈程序员站长】
Laravel的config下一般存放配置信息,可以通过config('key')方法获取指定的数据。
设置值可通过「点」式语法读取,其中包含要访问的文件名以及选项名称。
现在想读取\config\app.PHP文件的url,文件中数据为:
'url' => 'http://localhost',获取方法:
config('app.url')如果找不到app.url,会返回默认返回第二个参数。
config('app.url', 'default_val')发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113175.html原文链接:https://javaforall.cn
边栏推荐
- Multiplication in pytorch: mul (), multiply (), matmul (), mm (), MV (), dot ()
- Good news! Kelan sundb database and Hongshu technology privacy data protection management software complete compatibility adaptation
- three.js打造酷炫下雪效果
- 讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!
- Communication mode between application program and MATLAB
- 招标公告:福建省农村信用社联合社数据库审计系统采购项目(重新招标)
- Apache Doris just "graduated": why should we pay attention to this kind of SQL data warehouse?
- Learn good-looking custom scroll bars in 1 minute
- LeetCode3_ Longest substring without duplicate characters
- 47_Opencv中的轮廓查找 cv::findContours()
猜你喜欢

Continuous creation depends on it!

Description of vs common shortcut keys

Eye of depth (VII) -- Elementary Transformation of matrix (attachment: explanation of some mathematical models)

Postman generate timestamp, future timestamp

Mesh merging under ue4/ue5 runtime

TiDB For PostgreSQL和YugabyteDB在Sysbench上的性能对比

Three. JS introductory learning notes 10:three JS grid

无线传感器网络--ZigBee和6LoWPAN

过度依赖补助,大客户收款难,冲刺“国产数据库第一股”的达梦后劲有多足?

Three. JS introductory learning notes 19: how to import FBX static model
随机推荐
Plate - forme de surveillance par étapes zabbix
修改配置文件后tidb无法启动
Rongyun won the 2022 China Xinchuang digital office portal excellence product award!
深度之眼(六)——矩阵的逆(附:logistic模型一些想法)
asyncio 概念和用法
Wireless sensor networks -- ZigBee and 6LoWPAN
torch.numel作用
Please supervise the 2022 plan
LeetCode2_ Add two numbers
Three. JS introduction learning notes 12: the model moves along any trajectory line
10 schemes to ensure interface data security
The unity vector rotates at a point
通知Notification使用全解析
JS array foreach source code parsing
Apache Doris just "graduated": why should we pay attention to this kind of SQL data warehouse?
laravel 是怎么做到运行 composer dump-autoload 不清空 classmap 映射关系的呢?
Numpy -- data cleaning
Odoo集成Plausible埋码监控平台
Whole process analysis of unity3d rendering pipeline
航天宏图信息中标乌鲁木齐某单位数据库系统研发项目