Skip to content

Commit

Permalink
Fix treeview (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
WebVPF authored Feb 27, 2024
1 parent 622886b commit 2b5e6e1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions database/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2b5e6e1

Please sign in to comment.