getRecord(); $attachments = $this->data['attachments'] ?? []; $collection = $this->data['attachment_collection'] ?? 'general'; $feedback->interactions()->create([ 'user_id' => auth()->id(), 'type' => 'note', 'content' => 'Feedback created via ' . ($feedback->feedbackChannel?->name ?? 'unknown channel'), 'changes' => ['status' => ['old' => null, 'new' => $feedback->status]], ]); if (! empty($attachments)) { $disk = Storage::disk('local'); foreach ($attachments as $path) { $feedback->attachments()->create([ 'uuid' => (string) \Illuminate\Support\Str::uuid(), 'user_id' => auth()->id(), 'name' => basename($path), 'path' => $path, 'disk' => 'local', 'collection' => $collection, 'mime_type' => $disk->mimeType($path), 'size' => $disk->size($path), ]); } } } }