Home > Database > Mysql Tutorial > Detailed explanation of commonly used directory paths in laravel framework

Detailed explanation of commonly used directory paths in laravel framework

小云云
Release: 2018-03-30 14:46:10
Original
2418 people have browsed it

This article mainly shares with you the detailed explanation of commonly used directory paths in the laravel framework. I hope it can help you.
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 an absolute path 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 project root directory:
$path = base_path();
You can also use the base_path function to generate an absolute path for a given file relative to the application directory:
$path = base_path('vendor/bin');
config_path()
The config_path function returns the application configuration directory The absolute path:
$path = config_path();
database_path()
database_path function returns the absolute path of the application database directory:
$path = database_path();
public_path()
public_path function returns the absolute path of the public directory:
$path = public_path();
storage_path()
storage_path function returns the absolute path of the storage directory:
$path = storage_path();
You can also use the storage_path function to generate the absolute path to a given file relative to the storage directory:
$path = storage_path('app/file.txt');
The built-in helper function to get the path of the laravel project is basically It's all here.

Related recommendations:

Laravel framework performance tuning method

The above is the detailed content of Detailed explanation of commonly used directory paths in laravel framework. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template