SanchayaFile & Metadata
The SanchayaFile Eloquent model represents every indexed file and directory in Sanchaya.
Metadata & SEO Properties
| Property / Accessor | Type | Description |
|---|---|---|
$file->alt_text | string | Image alternative text for accessibility & SEO. |
$file->title | string | Human-friendly title attribute. |
$file->caption | string | Media caption for galleries. |
$file->description | string | Long-form description / notes. |
$file->getMetadata($key, $default) | mixed | Access metadata using dot-notation (e.g. $file->getMetadata('exif.camera')). |
$file->setMetadata($key, $value) | SanchayaFile | Set custom metadata using dot-notation; call save() to persist it. |
Core Accessors & Scopes
| Accessor / Scope | Type | Description |
|---|---|---|
$file->display_name | string | Original upload name or formatted folder name. |
$file->url | ?string | Resolved storage URL. |
$file->preview_url | ?string | Accessible public or temporary file URL when the disk supports one. |
$file->human_size | string | Formatted size string (e.g., "3.2 MB"). |
$file->is_image / is_video | bool | MIME type helpers. |
SanchayaFile::query()->folders() | Query | Filter only folders. |
SanchayaFile::query()->files() | Query | Filter only files. |
SanchayaFile::query()->onDisk($disk) | Query | Filter by filesystem disk. |
SanchayaFile::query()->ofMimeGroup('image') | Query | Filter by MIME group. |