当前位置:网站首页>How can laravel get the public path
How can laravel get the public path
2022-07-07 16:20:00 【Full stack programmer webmaster】
app_path()
app_path The function returns app The absolute path to the directory :
$path = app_path();
You can still use it app_path The function is relative to app The given file of the directory generates an absolute path :
$path = app_path('Http/Controllers/Controller.php');
base_path()
base_path Function returns the absolute path of the project root directory :
$path = base_path();
You can still use it base_path The function generates an absolute path for a given file relative to the application directory :
$path = base_path('vendor/bin');
config_path()
config_path Function returns the absolute path of the application configuration directory :
$path = config_path();
database_path()
database_path Function returns the absolute path of the application database directory :
$path = database_path();
public_path()
public_path The function returns public The absolute path to the directory :
$path = public_path();
storage_path()
storage_path The function returns storage The absolute path to the directory :
$path = storage_path();
You can also use storage_path Function generation relative to storage The absolute path of the given file of the directory :
$path = storage_path('app/file.txt');
obtain laravel The built-in help functions of the project path are basically here
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/113203.html Link to the original text :https://javaforall.cn
边栏推荐
- Step by step monitoring platform ZABBIX
- 模仿企业微信会议室选择
- What else can an ordinary person do besides working in a factory to make money?
- Three. JS introductory learning notes 15: threejs frame animation module
- Three. JS introductory learning notes 10:three JS grid
- Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import
- Unity3D_ Class fishing project, control the distance between collision walls to adapt to different models
- Shader basic UV operations, translation, rotation, scaling
- 持续创作,还得靠它!
- Unity的三种单例模式(饿汉,懒汉,MonoBehaviour)
猜你喜欢
Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import
SysOM 案例解析:消失的内存都去哪了 !| 龙蜥技术
Unity drawing plug-in = = [support the update of the original atlas]
Three. JS introductory learning notes 11:three JS group composite object
Odoo integrated plausible embedded code monitoring platform
Plate - forme de surveillance par étapes zabbix
无线传感器网络--ZigBee和6LoWPAN
Numpy -- epidemic data analysis case
Three. JS introductory learning notes 18: how to export JSON files with Blender
Wireless sensor networks -- ZigBee and 6LoWPAN
随机推荐
Odoo集成Plausible埋码监控平台
How to implement backspace in shell
Sysom case analysis: where is the missing memory| Dragon lizard Technology
喜讯!科蓝SUNDB数据库与鸿数科技隐私数据保护管理软件完成兼容性适配
There are many ways to realize the pause function in JS
【HCSD大咖直播】亲授大厂面试秘诀-简要笔记
Application example of infinite list [uigridview]
融云斩获 2022 中国信创数字化办公门户卓越产品奖!
平衡二叉树(AVL)
How to determine whether the checkbox in JS is selected
持续创作,还得靠它!
Unity drawing plug-in = = [support the update of the original atlas]
Three. JS introduction learning notes 12: the model moves along any trajectory line
MySQL中, 如何查询某一天, 某一月, 某一年的数据
星瑞格数据库入围“2021年度福建省信息技术应用创新典型解决方案”
The unity vector rotates at a point
2022山东智慧养老展,适老穿戴设备展,养老展,山东老博会
神经网络c语言中的指针是怎么回事
企业级日志分析系统ELK
分步式监控平台zabbix