Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the common directory path in laravel framework

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you what the commonly used directory path in the laravel framework is, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

App_path ()

The app_path function returns the absolute path to the app directory:

$path = app_path ()

You can also use the app_path function to generate absolute paths for a given file relative to the app directory:

$path = app_path ('Http/Controllers/Controller.php')

Base_path ()

The base_path function returns the absolute path to the root of the project:

$path = base_path ()

You can also use the base_path function to generate absolute paths for a given file relative to the application directory:

$path = base_path ('vendor/bin')

Config_path ()

The config_path function returns the absolute path to the application configuration directory:

$path = config_path ()

Database_path ()

The database_path function returns the absolute path to the application database directory:

$path = database_path ()

Public_path ()

The public_path function returns the absolute path to the public directory:

$path = public_path ()

Storage_path ()

The storage_path function returns the absolute path to the storage directory:

$path = storage_path ()

You can also use the storage_path function to generate an absolute path to a given file relative to the storage directory:

$path = storage_path ('app/file.txt')

The above is all the contents of the article "what are the common directory paths in the laravel framework?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report