- Directory Structure
- Root Directory
Below is the current proposed directory structure for sites using Mantle. This will certainly change and expand as Mantle develops. The tree is assumed to be placed inside of a
. ├── README.md ├── app │ ├── console │ │ └── class-example-command.php │ ├── jobs │ │ └── class-example-job.php │ ├── models │ │ └── class-example-post.php │ └── providers │ └── class-app-service-provider.php ├── bootstrap │ └── app.php ├── composer.json ├── config │ └── app.php ├── database │ ├── factories │ │ └── post-factory.php │ └── seeds │ └── class-database-seeder.php ├── routes │ ├── cli.php │ ├── rest-api.php │ └── web.php └── tests ├── class-test-case.php ├── feature │ └── test-example.php └── unit └── test-example.php
The App Directory
app diretory contains the core code of your application. This includes console commands, routes, models, providers, and more. Most of the application will live inside of this folder. By default this folder is namespaced
App and autoloaded using a WordPress-style autoloader.
The Bootstrap Directory
bootstrap directory contains the
app.php file which bootstraps and loads the framework. It can also contain a
cache folder which contains framework generated files for performance optimization including routes and packages.
The Config Directory
config directory contains the application configuration. For more information about this, read the Configuration documentation page.
The Database Directory
database directory contains the database factories and seeders used to initialize the database for testing. For more information about this, read the 'Model Factory' documentation page.
The Routes Directory
routes directory contains all of the application's HTTP route definitions. By default, this includes
rest-api.php for web and REST API routes, respectively.
The Tests Directory
tests directory contains the automated tests for the application powered by PHPUnit and the Mantle Test Framework.