'boolean', 'metadata' => 'array', 'security_meta' => 'array', 'security_scanned_at' => 'datetime', ]; protected $attributes = [ 'security_scan_status' => 'pending', 'ingest_source' => self::SOURCE_GUEST_PWA, ]; public function mediaAsset(): BelongsTo { return $this->belongsTo(EventMediaAsset::class, 'media_asset_id'); } public function getImagePathAttribute(): ?string { return $this->file_path; } public function setImagePathAttribute(string $value): void { $this->attributes['file_path'] = $value; } public function event(): BelongsTo { return $this->belongsTo(Event::class); } public function emotion(): BelongsTo { return $this->belongsTo(Emotion::class); } public function task(): BelongsTo { return $this->belongsTo(Task::class); } public function likes(): HasMany { return $this->hasMany(PhotoLike::class); } public static function supportsFilenameColumn(): bool { return static::hasColumn('filename'); } public static function hasColumn(string $column): bool { if (static::$columnCache === null) { static::$columnCache = Schema::getColumnListing((new self)->getTable()); } return in_array($column, static::$columnCache, true); } public function tenant(): BelongsToThroughRelation { return $this->belongsToThrough( Tenant::class, Event::class ); } }