Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the common directory path in laravel framework

Shulou Source: shulou.com Published: 2022-05-31 23:50:46 10月04日 Update

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!

Tags: Path directory function file article application generation commonly used framework content not much most data database more root directory knowledge industry information information channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Xiaomi Redmi Shulou Information OPPO Reno