From 9e8df4f7ee35ed7fbe3f3ced83ecbab25ebc0dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez?= Date: Sun, 26 Apr 2026 13:39:19 -0600 Subject: [PATCH] fix: usar disco uploads en public/ para compatibilidad con cPanel sin symlinks Co-Authored-By: Claude Sonnet 4.6 --- app/Http/Controllers/ChatController.php | 2 +- config/filesystems.php | 9 +++++++++ public/uploads/.gitkeep | 0 public/uploads/chat/.gitkeep | 0 resources/views/chat/show.blade.php | 10 +++++----- 5 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 public/uploads/.gitkeep create mode 100644 public/uploads/chat/.gitkeep diff --git a/app/Http/Controllers/ChatController.php b/app/Http/Controllers/ChatController.php index ae9ca4c1..49372303 100644 --- a/app/Http/Controllers/ChatController.php +++ b/app/Http/Controllers/ChatController.php @@ -55,7 +55,7 @@ class ChatController extends Controller if ($request->hasFile('attachment')) { $file = $request->file('attachment'); - $attachment = $file->store('chat', 'public'); + $attachment = $file->store('chat', 'uploads'); $mime = $file->getMimeType(); if (str_starts_with($mime, 'image')) $attachmentType = 'image'; diff --git a/config/filesystems.php b/config/filesystems.php index 3d671bd9..21cd5774 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -47,6 +47,15 @@ return [ 'report' => false, ], + 'uploads' => [ + 'driver' => 'local', + 'root' => public_path('uploads'), + 'url' => env('APP_URL').'/uploads', + 'visibility' => 'public', + 'throw' => false, + 'report' => false, + ], + 's3' => [ 'driver' => 's3', 'key' => env('AWS_ACCESS_KEY_ID'), diff --git a/public/uploads/.gitkeep b/public/uploads/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/public/uploads/chat/.gitkeep b/public/uploads/chat/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/resources/views/chat/show.blade.php b/resources/views/chat/show.blade.php index eda5e0c5..1af3538b 100644 --- a/resources/views/chat/show.blade.php +++ b/resources/views/chat/show.blade.php @@ -27,17 +27,17 @@ @endif @if($msg->attachment) @if($msg->attachment_type === 'image') - + @elseif($msg->attachment_type === 'audio') @elseif($msg->attachment_type === 'video') @else - + Ver archivo @endif @@ -86,7 +86,7 @@