Database Schema
sanchaya_files
| Column | Type | Notes |
|---|---|---|
id | bigint unsigned | Primary key |
parent_id | bigint unsigned (nullable) | Self-referencing parent folder foreign key |
type | string | file or folder |
disk | string | Filesystem disk name |
path | text | Full relative path on disk |
file_name | string | Physical file name on disk |
original_name | string | Original user-facing file name |
extension | string (nullable) | File extension (lowercase) |
mime_type | string (nullable) | Detected MIME type |
size | bigint unsigned | Size in bytes (0 for folders) |
metadata | json (nullable) | JSON object storing alt text, SEO, and custom attributes |
deleted_at | timestamp (nullable) | Soft delete timestamp |
sanchaya_attachments
| Column | Type | Notes |
|---|---|---|
id | bigint unsigned | Primary key |
sanchaya_file_id | bigint unsigned | Foreign key referencing sanchaya_files.id |
attachable_type | string | Polymorphic model class name |
attachable_id | unsignedBigInteger | Polymorphic model ID created by morphs() |
group | string (nullable) | Slot/category name (e.g., 'avatar', 'gallery') |
order | integer | Sort position for multiple attachments |