Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix treeview #175

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading