The directories included are: 1. app directory; 2. bootstrap directory; 3. config directory; 4. database directory; 5. public directory; 6. resources directory; 7. routes directory; 8. storage directory ;9. Vendor directory, etc.
![What directories are included in the laravel project](https://img.php.cn/upload/article/202109/23/2021092319081217430.jpg)
The operating environment of this tutorial: Windows 7 system, Laravel version 5, Dell G3 computer.
Directories included in the laravel project
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/67cc60f90c0d3b020e28307741cad75c-0.png)
The app directory is the core directory of the project, mainly used to store core code, including controllers and models, where
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/67cc60f90c0d3b020e28307741cad75c-1.png)
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/b3c05f31ce7a2ef247b5834147501bc8-2.png)
Under this path is the controller, where Controller.php is the base class (parent class) controller
Auth is the default user authentication controller provided by the system
The controller can be managed in separate directories
##bootstrap directory
is the startup directory of laravel
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/b3c05f31ce7a2ef247b5834147501bc8-3.png)
config directory
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/82c8980e15f55e92e8df6a09dc88d265-4.png)
##app.php is the main configuration file of the project
- auth.php is the configuration file used to define user authentication (login)
- database.php is the configuration file for the database
- filesystems.php is the configuration needed to upload files and file storage The file
- mail.php is the mail configuration file
- session.php is the session control
- view.php is the view
- cache.php is the cache
-
database directory
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/82c8980e15f55e92e8df6a09dc88d265-5.png)
When creating a table, it needs to be created through a PHP file. Class to create, that is, create a class in migrations. This file is also called a migration file (create a data table file)
- The seeds file stores some data filling files for the data table
public directory
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/8db92c01d6c9fcac4888bd6cf4aa4c19-6.png)
The entry file of the project (index.php) is placed in this file, which can be done A single entry file, in which the css and js files of later projects are placed in this directory.
- Therefore, when configuring the virtual host, you need to specify the site directory under the public directory
resources directory
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/8db92c01d6c9fcac4888bd6cf4aa4c19-7.png)
#The lang directory is the language pack (if the project needs to be localized, you need to configure the language pack)
- views is the view directory, which is the view file storage Directory (view files can also be managed in sub-directories)
routes directory
is the directory where routes are defined, where web.php is where routes are defined document.
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/39fa7acd06c256b2059e996ab247d20b-8.png)
storage directory
The storage directory is the directory where cache files and log files are stored. If the files uploaded by the user are placed locally, It is also placed in storage.
![What directories are included in the laravel project](https://img.php.cn/upload/article/000/000/024/39fa7acd06c256b2059e996ab247d20b-9.png)
##app- The file is to store the file uploaded by the user
framework- is the cache file when the framework is running
logs- is the log directory
vendor directory
Third-party content when stored
.env file
is to set some system-related environment configuration file information
artisan file
is a scaffolding file, mainly used for generated code (automatic generation), such as automatically generating controller and model files. When using artisan, you must ensure that artisan is in the current working path of the command line. (No need to modify, just use it).
Related recommendations: The latest five Laravel video tutorials
The above is the detailed content of What directories are included in the laravel project. For more information, please follow other related articles on the PHP Chinese website!