当前位置:网站首页>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
边栏推荐
- Dotween -- ease function
- Rongyun won the 2022 China Xinchuang digital office portal excellence product award!
- 安科瑞电网智能化发展的必然趋势电力系统采用微机保护装置是
- laravel 是怎么做到运行 composer dump-autoload 不清空 classmap 映射关系的呢?
- TiDB For PostgreSQL和YugabyteDB在Sysbench上的性能对比
- Three. JS introductory learning notes 08:orbitcontrols JS plug-in - mouse control model rotation, zoom in, zoom out, translation, etc
- Common training data set formats for target tracking
- Performance measure of classification model
- 2022 the 4th China (Jinan) International Smart elderly care industry exhibition, Shandong old age Expo
- 记一次项目的迁移过程
猜你喜欢
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
Unity3D_ Class fishing project, bullet rebound effect is achieved
Three. JS introductory learning notes 18: how to export JSON files with Blender
pycharm 终端部启用虚拟环境
Continuous creation depends on it!
What are compiled languages and interpreted languages?
2022第四届中国(济南)国际智慧养老产业展览会,山东老博会
航运船公司人工智能AI产品成熟化标准化规模应用,全球港航人工智能/集装箱人工智能领军者CIMC中集飞瞳,打造国际航运智能化标杆
[flower carving experience] 15 try to build the Arduino development environment of beetle esp32 C3
Apache Doris刚“毕业”:为什么应关注这种SQL数据仓库?
随机推荐
尤雨溪,来了!
Mysql database basic operation DQL basic query
Apache Doris刚“毕业”:为什么应关注这种SQL数据仓库?
prometheus api删除某个指定job的所有数据
laravel post提交数据时显示异常
Unity的三种单例模式(饿汉,懒汉,MonoBehaviour)
Notification uses full resolution
Numpy -- data cleaning
Three. JS introductory learning notes 15: threejs frame animation module
Bidding announcement: Panjin people's Hospital Panjin hospital database maintenance project
Unity3D_ Class fishing project, bullet rebound effect is achieved
Laravel 服务提供者实例教程 —— 创建 Service Provider 测试实例
Laravel5.1 路由 -路由分组
航运船公司人工智能AI产品成熟化标准化规模应用,全球港航人工智能/集装箱人工智能领军者CIMC中集飞瞳,打造国际航运智能化标杆
Three. JS introductory learning notes 11:three JS group composite object
hellogolang
MySQL数据库基本操作-DQL-基本查询
What are compiled languages and interpreted languages?
Three. JS introductory learning notes 19: how to import FBX static model
hellogolang