Skip to content

Commit

Permalink
Uploads under user name
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed May 19, 2024
1 parent f4fc780 commit 6bcc353
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Livewire/SendMessageInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function sendMessage(): void

if ($this->attachments) {
foreach ($this->attachments as $attachment) {
$path = $attachment->store('public/attachments');
$path = $attachment->store('public/'.$this->loggedInUser->name.'/attachments');
Attachment::create([
'message_id' => $message->id,
'name' => $attachment->getClientOriginalName(),
Expand Down
4 changes: 2 additions & 2 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ input:-webkit-autofill {
}

.received-message-attachment{
@apply rounded-b-2xl rounded-tr-2xl bg-gray-200 text-gray-700 p-1 mt-1 px-4;
@apply rounded-b-2xl overflow-clip rounded-tr-2xl bg-gray-200 text-gray-700 p-1 mt-1;
}

.sent-message-attachment{
@apply rounded-b-2xl rounded-tl-2xl bg-blue-500 text-white p-1 mt-1 px-4;
@apply rounded-b-2xl overflow-clip rounded-tl-2xl bg-blue-500 text-white p-1 mt-1;
}

.message-input{
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/display-chat-message.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class="inline-block {{ $message->sender_id == Auth::id() ? 'bg-blue-500 text-whi
<div class="min-w-[128px]">
<div
onclick="viewAttachment('{{ $attachment->type }}', '{{ Storage::url($attachment->path) }}')"
class="bg-gray-200 rounded-xl overflow-hidden relative">
class="bg-gray-200 rounded-xl ring-1 ring-white overflow-hidden relative">
@if (in_array($attachment->type, ['image/jpeg', 'image/png', 'image/gif']))
<img
src="{{ Storage::url($attachment->path) }}"
Expand Down

0 comments on commit 6bcc353

Please sign in to comment.