Below is the current proposed directory structure for sites using Mantle. The
tree is assumed to be placed inside of a
│ ├── console
│ │ └── class-example-command.php
│ ├── jobs
│ │ └── class-example-job.php
│ ├── models
│ │ └── class-example-post.php
│ └── providers
│ └── class-app-service-provider.php
│ └── app.php
│ └── app.php
│ ├── factories
│ │ └── class-post-factory.php
│ └── seeds
│ └── class-database-seeder.php
│ ├── cli.php
│ ├── rest-api.php
│ └── web.php
│ └── 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
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
The Tests Directory
tests directory contains the automated tests for the application powered
by PHPUnit and the Mantle Test Framework.