'integer', 'is_public' => 'boolean', 'contentuid' => 'integer', 'created_by' => 'integer', 'updated_by' => 'integer', 'details' => 'array', 'useruid_access_list' => 'array', 'tags'=>'array', ]; /** * Reference to file content */ public function fileContent() { return $this->belongsTo(FileContent::class, 'contentuid'); } public function creator() { return $this->belongsTo(User::class, 'created_by'); } public function updater() { return $this->belongsTo(User::class, 'updated_by'); } /** * Resolve a usable URL for this file. Prefers `cdn_url` (e.g. a * jsDelivr-fronted CDN asset) when set; otherwise falls back to the * local /RequestData/File/{hash} route. */ public function resolvedUrl(): string { $cdn = trim((string) ($this->cdn_url ?? '')); if ($cdn !== '') { return $cdn; } return "/RequestData/File/{$this->hashkey}"; } }