From 2b5e6e1cbac47af2265b699ba5c3e1b1589120fb Mon Sep 17 00:00:00 2001 From: WebVPF <61043464+WebVPF@users.noreply.github.com> Date: Tue, 27 Feb 2024 10:15:04 +0200 Subject: [PATCH] Fix treeview (#175) --- database/model.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/database/model.md b/database/model.md index 54d52444..a0a9060c 100644 --- a/database/model.md +++ b/database/model.md @@ -4,18 +4,18 @@ Winter provides a beautiful and simple Active Record implementation for working with your database, based on [Eloquent by Laravel](http://laravel.com/docs/eloquent). Each database table has a corresponding "Model" which is used to interact with that table. Models allow you to query for data in your tables, as well as insert new records into the table. -Model classes reside in the **models** subdirectory of a plugin directory. An example of a model directory structure: - -```css -📂 plugins - ┗ 📂 acme - ┗ 📂 blog - ┣ 📂 models - ┃ ┣ 📂 user <=== Model config directory - ┃ ┃ ┣ 📜 columns.yaml <=== Model config files - ┃ ┃ ┗ 📜 fields.yaml <==^ - ┃ ┗ 📜 User.php <=== Model class - ┗ 📜 Plugin.php +Model classes reside in the `models` subdirectory of a plugin directory. An example of a model directory structure: + +```treeview +plugins/ +`-- acme/ + `-- blog/ + |-- models/ # Plugin models directory + | |-- user/ # Model configuration directory + | | |-- columns.yaml # Model list columns config file + | | `-- fields.yaml # Model form fields config file + | `-- User.php # Model class + `-- Plugin.php ``` The model configuration directory could contain the model's [list column](../backend/lists#defining-list-columns) and [form field](../backend/forms#defining-form-fields) definitions. The model configuration directory name matches the model class name written in lowercase.