fix: attachment file handling - real files, inline preview, click to open
Some checks failed
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled
Tests / PHP 8.5 (push) Has been cancelled

- FileService: use Storage::temporaryUrl() standard API instead of manual signed route
- FileService: added isImage() and getPreviewUrl() helpers
- Seeder: create actual files on disk instead of fake paths
- Edit Feedback: new 'Attachments' section showing all feedback files with thumbnails
- Interactions modal: image preview thumbnails + inline click-to-open
- New footer layout: edit-footer.blade.php wrapper for attachments + similar cases
This commit is contained in:
2026-04-27 09:30:20 +00:00
parent 694d6f7c63
commit 6c74c17b48
7 changed files with 146 additions and 39 deletions

View File

@@ -222,6 +222,9 @@ class AfterSalesSeeder extends Seeder
'reason' => 'Vấn đề kỹ thuật về điều hòa, cần Phòng Kỹ thuật kiểm tra và xử lý.',
]);
$disk = \Illuminate\Support\Facades\Storage::disk('local');
$disk->put('feedback-attachments/ac_repair_report.pdf', '%PDF-1.4 Demo report content');
\App\Models\FeedbackAttachment::create([
'uuid' => \Illuminate\Support\Str::uuid(),
'feedback_id' => $allFeedback[2]->id,
@@ -231,9 +234,10 @@ class AfterSalesSeeder extends Seeder
'disk' => 'local',
'collection' => 'proof_of_resolution',
'mime_type' => 'application/pdf',
'size' => 204800,
'size' => $disk->size('feedback-attachments/ac_repair_report.pdf'),
]);
$disk->put('feedback-attachments/ceiling_photo.jpg', 'dummy-jpeg-content');
\App\Models\FeedbackAttachment::create([
'uuid' => \Illuminate\Support\Str::uuid(),
'feedback_id' => $allFeedback[0]->id,
@@ -243,9 +247,10 @@ class AfterSalesSeeder extends Seeder
'disk' => 'local',
'collection' => 'customer_evidence',
'mime_type' => 'image/jpeg',
'size' => 512000,
'size' => $disk->size('feedback-attachments/ceiling_photo.jpg'),
]);
$disk->put('feedback-attachments/replaced_hinge_photo.png', 'dummy-png-content');
\App\Models\FeedbackAttachment::create([
'uuid' => \Illuminate\Support\Str::uuid(),
'feedback_id' => $allFeedback[4]->id,
@@ -255,7 +260,7 @@ class AfterSalesSeeder extends Seeder
'disk' => 'local',
'collection' => 'proof_of_resolution',
'mime_type' => 'image/png',
'size' => 307200,
'size' => $disk->size('feedback-attachments/replaced_hinge_photo.png'),
]);
}
}