当前位置:网站首页>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
边栏推荐
- PHP实现执行定时任务的几种思路详解
- torch.numel作用
- Regular expression string
- A link opens the applet code. After compilation, it is easy to understand
- Introduction to pyGame games
- laravel中将session由文件保存改为数据库保存
- thinkphp3.2.3中设置路由,优化url
- Talk about the cloud deployment of local projects created by SAP IRPA studio
- laravel 是怎么做到运行 composer dump-autoload 不清空 classmap 映射关系的呢?
- What are compiled languages and interpreted languages?
猜你喜欢
【花雕体验】15 尝试搭建Beetle ESP32 C3之Arduino开发环境
喜讯!科蓝SUNDB数据库与鸿数科技隐私数据保护管理软件完成兼容性适配
山东老博会,2022中国智慧养老展会,智能化养老、适老科技展
L'application à l'échelle de la normalisation mature des produits ai des compagnies maritimes, cimc, leader mondial de l'intelligence artificielle portuaire et maritime / intelligence artificielle des
Application example of infinite list [uigridview]
Xcode Revoke certificate
Shipping companies' AI products are mature, standardized and applied on a large scale. CIMC, the global leader in port and shipping AI / container AI, has built a benchmark for international shipping
Enterprise log analysis system elk
Eye of depth (VI) -- inverse of matrix (attachment: some ideas of logistic model)
无线传感器网络--ZigBee和6LoWPAN
随机推荐
Three. JS introductory learning notes 19: how to import FBX static model
Three. JS introductory learning notes 08:orbitcontrols JS plug-in - mouse control model rotation, zoom in, zoom out, translation, etc
平衡二叉树(AVL)
PHP实现执行定时任务的几种思路详解
Unity的三种单例模式(饿汉,懒汉,MonoBehaviour)
C4D learning notes 3- animation - animation rendering process case
Excessive dependence on subsidies, difficult collection of key customers, and how strong is the potential to reach the dream of "the first share of domestic databases"?
47_ Contour lookup in opencv cv:: findcontours()
Bidding announcement: 2022 Yunnan Unicom gbase database maintenance public comparison and selection project (second) comparison and selection announcement
How to implement backspace in shell
Odoo integrated plausible embedded code monitoring platform
three.js打造酷炫下雪效果
Xcode Revoke certificate
Application example of infinite list [uigridview]
[excelexport], Excel to Lua, JSON, XML development tool
leetcode 241. Different ways to add parentheses design priority for operational expressions (medium)
Markdown formula editing tutorial
Three. JS introduction learning notes 12: the model moves along any trajectory line
Performance comparison of tidb for PostgreSQL and yugabytedb on sysbench
Numpy -- epidemic data analysis case