当前位置:网站首页>laravel怎么获取到public路径
laravel怎么获取到public路径
2022-07-07 14:07:00 【全栈程序员站长】
app_path()
app_path函数返回app目录的绝对路径:
$path = app_path();
你还可以使用app_path函数为相对于app目录的给定文件生成绝对路径:
$path = app_path('Http/Controllers/Controller.php');
base_path()
base_path函数返回项目根目录的绝对路径:
$path = base_path();
你还可以使用base_path函数为相对于应用目录的给定文件生成绝对路径:
$path = base_path('vendor/bin');
config_path()
config_path函数返回应用配置目录的绝对路径:
$path = config_path();
database_path()
database_path函数返回应用数据库目录的绝对路径:
$path = database_path();
public_path()
public_path函数返回public目录的绝对路径:
$path = public_path();
storage_path()
storage_path函数返回storage目录的绝对路径:
$path = storage_path();
还可以使用storage_path函数生成相对于storage目录的给定文件的绝对路径:
$path = storage_path('app/file.txt');
获取laravel项目的路径的内置帮助函数基本都在这了
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113203.html原文链接:https://javaforall.cn
边栏推荐
- Xcode Revoke certificate
- Limit of total fields [1000] in index has been exceeded
- 2022 the 4th China (Jinan) International Smart elderly care industry exhibition, Shandong old age Expo
- TS typescript type declaration special declaration field number is handled when the key key
- Bidding announcement: Panjin people's Hospital Panjin hospital database maintenance project
- SPI master rx time out中断
- 喜讯!科蓝SUNDB数据库与鸿数科技隐私数据保护管理软件完成兼容性适配
- Bidding announcement: Fujian Rural Credit Union database audit system procurement project (re bidding)
- AB package details in unity (super detail, features, packaging, loading, manager)
- prometheus api删除某个指定job的所有数据
猜你喜欢
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
航運船公司人工智能AI產品成熟化標准化規模應用,全球港航人工智能/集裝箱人工智能領軍者CIMC中集飛瞳,打造國際航運智能化標杆
Eye of depth (VII) -- Elementary Transformation of matrix (attachment: explanation of some mathematical models)
JS array foreach source code parsing
模仿企业微信会议室选择
C4D learning notes 2- animation - timeline and time function
Multiplication in pytorch: mul (), multiply (), matmul (), mm (), MV (), dot ()
喜讯!科蓝SUNDB数据库与鸿数科技隐私数据保护管理软件完成兼容性适配
numpy--数据清洗
Three. JS introductory learning notes 10:three JS grid
随机推荐
Migration and reprint
Regular expression string
Please supervise the 2022 plan
numpy--疫情数据分析案例
Continuous creation depends on it!
Three. JS introductory learning notes 05: external model import -c4d into JSON file for web pages
航天宏图信息中标乌鲁木齐某单位数据库系统研发项目
Three. JS introductory learning notes 00: coordinate system, camera (temporarily understood)
Unity drawing plug-in = = [support the update of the original atlas]
安科瑞电网智能化发展的必然趋势电力系统采用微机保护装置是
Enterprise log analysis system elk
Three. Introduction to JS learning notes 17: mouse control of 3D model rotation of JSON file
Shader_ Animation sequence frame
SysOM 案例解析:消失的内存都去哪了 !| 龙蜥技术
如何在shell中实现 backspace
招标公告:福建省农村信用社联合社数据库审计系统采购项目(重新招标)
Three. JS introductory learning notes 0: illustration of how webgl and threejs work
修改配置文件后tidb无法启动
Postman generate timestamp, future timestamp
2022 the 4th China (Jinan) International Smart elderly care industry exhibition, Shandong old age Expo