ποΈ Database Models
This documentation provides a comprehensive overview of all database models in the application, their properties, relationships, and usage patterns.
π Overview
- π Total Models Documented: 37
- π§ Common Features:
- π All models use UUIDs (except Language, Country, User)
- π·οΈ All models have
internal_name
andbackward_compatibility
fields - π Relationships are defined using Eloquent ORM best practices
- π Translations are handled via dedicated translation models
- π Many models support polymorphic and many-to-many relationships
π― Key Model Categories
π Geographic Models
- π Address, Location, Province: Represent geographical entities, each with translation models
π₯ People & Organizations
- π¨ Artist, Author, Partner: Represent people/entities, with relationships to items and collections
π¦ Core Content Models
- ποΈ Item, Collection, Exhibition, Gallery, Theme: Core content models, supporting translations, partners, and hierarchical relationships
πΌοΈ Media Models
- πΈ Picture, ImageUpload, AvailableImage: Handle image storage and metadata
π·οΈ Classification
- π Tag: Supports tagging of items
π€ System Models
- π User: Standard Laravel user model
- π Language, Country: Use ISO codes as primary keys
π Relationship Types
Type | Icon | Description | Example |
---|---|---|---|
BelongsTo | β¬οΈ | Foreign key relationships | Item β Partner |
HasMany | β¬οΈ | One-to-many relationships | Country β Item |
BelongsToMany | βοΈ | Many-to-many relationships | Artist β Item |
MorphTo/MorphMany | π | Polymorphic relationships | Picture β Item/Detail/Partner |
π Translation System
- π£οΈ Most core models have a corresponding translation model (e.g., ItemTranslation, CollectionTranslation)
- π Translation models include language, context, and extra metadata fields
- π― Supports multi-language and multi-context content delivery
βοΈ Technical Features
π Scopes & Filtering
- π Models use Laravel scopes for filtering (e.g.,
default
,english
,forItem
) - β‘ Optimized query performance through strategic scoping
π οΈ Traits & Patterns
- π All models use
HasFactory
andHasUuids
traits where appropriate - π Consistent coding patterns across all models
- π Built-in security and validation features
π Complete Models Index
Click any model name below to view its detailed documentation with properties, relationships, and usage examples.
π€ Alphabetical Model List
Model | Category | Description |
---|---|---|
π Address | Geographic | Physical addresses with country relationships |
π AddressTranslation | Translation | Multi-language address translations |
π¨ Artist | People | Artists who create items in collections |
βοΈ Author | People | Authors of written content |
πΌοΈ AvailableImage | Media | Available images with metadata |
π¦ Collection | Content | Collections of museum items |
π€ CollectionPartner | Relationship | Collection-partner associations |
π CollectionTranslation | Translation | Multi-language collection content |
π Contact | Communication | Contact information storage |
π ContactTranslation | Translation | Multi-language contact labels |
βοΈ Context | Configuration | Application context settings |
πΊοΈ Country | Geographic | Countries using ISO codes |
π Detail | Content | Detailed item descriptions |
π DetailTranslation | Translation | Multi-language detail content |
ποΈ Exhibition | Content | Museum exhibitions |
π ExhibitionTranslation | Translation | Multi-language exhibition content |
πΌοΈ Gallery | Content | Image galleries |
π Galleryable | Relationship | Gallery content associations |
π€ GalleryPartner | Relationship | Gallery-partner associations |
π GalleryTranslation | Translation | Multi-language gallery content |
π€ ImageUpload | Media | Uploaded image metadata |
πΊ Item | Content | Core museum items |
π ItemTranslation | Translation | Multi-language item content |
π Language | Configuration | Supported languages (ISO codes) |
π Location | Geographic | Specific locations |
π LocationTranslation | Translation | Multi-language location names |
π’ Partner | Organization | Institutional partners |
πΈ Picture | Media | Images with metadata and relationships |
π PictureTranslation | Translation | Multi-language picture descriptions |
π Project | Management | Project management |
πΊοΈ Province | Geographic | Administrative provinces |
π ProvinceTranslation | Translation | Multi-language province names |
π·οΈ Tag | Classification | Content tagging system |
π― Theme | Content | Exhibition themes and subthemes |
π ThemeTranslation | Translation | Multi-language theme content |
π€ User | System | Application users |
π¨ Workshop | Content | Workshop information |
π‘ Tip: Use your browserβs search function (Ctrl+F / Cmd+F) to quickly find specific models in this list.
For an overview of model relationships and architecture, see the summary above.