Skip to content

Commit

Permalink
add: updated timestamp to user notes panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Roardom committed May 25, 2024
1 parent ef047ef commit 564043b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Livewire/UserNotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ final public function update(int $id): void
$this->validateOnly('messages.*');

Note::whereKey($id)->update([
'staff_id' => auth()->id(),
'message' => $this->messages[$id],
'staff_id' => auth()->id(),
'message' => $this->messages[$id],
'updated_at' => now(),
]);

$this->dispatch('success', type: 'success', message: 'Note has successfully been updated!');
Expand Down
9 changes: 9 additions & 0 deletions resources/views/livewire/user-notes.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class="form__button form__button--outlined"
<th>{{ __('common.staff') }}</th>
<th>{{ __('user.note') }}</th>
<th>{{ __('user.created-on') }}</th>
<th>{{ __('torrent.updated_at') }}</th>
<th>{{ __('common.action') }}</th>
</tr>
</thead>
Expand All @@ -67,6 +68,14 @@ class="form__button form__button--outlined"
{{ $note->created_at->diffForHumans() }}
</time>
</td>
<td>
<time
datetime="{{ $note->updated_at }}"
title="{{ $note->updated_at }}"
>
{{ $note->created_at->diffForHumans() }}
</time>
</td>
<td>
<menu class="data-table__actions">
<li
Expand Down

0 comments on commit 564043b

Please sign in to comment.