uuid = (string) \Illuminate\Support\Str::uuid(); }); } public function ticketMessage() { return $this->belongsTo(TicketMessage::class); } public function getLocalPathAttribute(): string { return storage_path("app/{$this->path}"); } // Function to check if attachment can be previewed public function canPreview(): bool { return Str::startsWith($this->mime_type, ['image/']); } }