Skip to content

Commit a7bc6c2

Browse files
committed
feat: update mvc docs
1 parent 03b3e02 commit a7bc6c2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/docs/mvc/index.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ For a fresh MVC app, the directory structure looks like this:
7676
│ ├── routes
7777
│ └── views
7878
│ └── errors
79+
├───config
7980
├───public
8081
│ └───assets
8182
│ ├── css
@@ -127,9 +128,9 @@ For a fresh MVC app, the directory structure looks like this:
127128

128129
- ### The `config` directory
129130

130-
The `config` directory contains the configuration files for your application. v3.8 and above do not come with a `config` directory out of the box, but you can publish the default configuration files using the [`config:publish` command](#configuring-leaf-mvc).
131+
The `config` directory contains the configuration files for your application. The configuration files are used to configure how Leaf and it's modules interact with your application. Each file controls a different feature of your application, e.g. the `app.php` file is used to configure the application, the `database.php` file is used to configure the database connection, etc.
131132

132-
The configuration files are used to configure how Leaf and it's modules interact with your application. Each file controls a different feature of your application, e.g. the `app.php` file is used to configure the application, the `database.php` file is used to configure the database connection, etc.
133+
Leaf MVC now allows you to completely remove this directory if you are only going to use the default configuration values which will make your application lighter. Leaf v3.8 and above allow you to publish the default configuration files using the [`config:publish` command](#configuring-leaf-mvc) if you end up deleting the `config` directory and want it back.
133134

134135
- ### The `public` directory
135136

@@ -145,21 +146,23 @@ For a fresh MVC app, the directory structure looks like this:
145146
- `framework` - Contains the framework generated files for your application.
146147
- `logs` - Contains the log files generated by your application.
147148

149+
This directory is not created by default in Leaf v3.8 and above. It will be automatically created when you run the `leaf serve` command, logging, storage link or any other command/module that requires it.
150+
148151
- ### The `vendor` directory
149152

150153
The `vendor` directory contains all the dependencies installed by Composer. It's automatically generated when you install the dependencies using Composer.
151154

152155
## Configuring Leaf MVC
153156

154-
Leaf MVC tries to maintain a clean and easy-to-understand structure that works out-of-the-box for most applications, which means that for most applications, you only need to change a few details in your .env file. For this reason, we don't ship with a `config` directory by default.
157+
Leaf MVC tries to maintain a clean and easy-to-understand structure that works out-of-the-box for most applications, which means that for most applications, you only need to change a few details in your .env file. For this reason, we allow you to completely remove the `config` directory if you are only going to use the default configuration values. This will make your application lighter and easier to maintain.
155158

156159
There are however some times when you need to customize some features to fit your specific use-cases, and that's where the configuration files come in. Leaf MVC separates the configuration files for each feature of the framework, so you can easily customize one feature without affecting the others. To publish all the default configuration files, you can run the following command:
157160

158161
```bash:no-line-numbers
159162
php leaf config:publish
160163
```
161164

162-
This will create a config directory in your application root and copy all the default configuration files to this directory just as we had in previous versions. You can then go ahead to customize the configuration files to fit your specific use-cases.
165+
This will re-create a config directory in your application root and copy all the default configuration files to this directory just as we had in previous versions. You can then go ahead to customize the configuration files to fit your specific use-cases.
163166

164167
Since Leaf MVC has defaults set for most of the configuration options, you don't need to change all the values in the configuration files, you only need to change only the specific values you want to customize so you can leave the rest of the configuration as it is. Each option is documented, so feel free to look through the files and get familiar with the options available to you.
165168

0 commit comments

Comments
 (0)