laravel 常用路径函数及生成URL函数

> 生成URL

1、url()或者secure_url()

  

2、asset()或者secure_asset()

  

3、action()

  

4、route()

  

> 常用路径

1、base_path()

返回项目根目录的绝对路径

2、app_path()

 返回项目app目录下的绝对路径

3、storage_path()

返回项目storage目录下的绝对路径

4、config_path()

返回项目config目录下的绝对路径

5、public_path()

返回项目public目录下的绝对路径

6、database_path()

返回项目database数据库目录下的绝对路径

原文地址:https://www.cnblogs.com/dreamboycx/p/15239585.html