Skip to content

Commit 5858a64

Browse files
committed
correction de l'erreur 500 afficher apres avoir commenté une discussion
1 parent 8a9ae6e commit 5858a64

File tree

4 files changed

+72
-60
lines changed

4 files changed

+72
-60
lines changed

app/Http/Livewire/Discussions/AddComment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public function saveComment(): void
5151
->duration(5000)
5252
->send();
5353

54-
$this->reset();
54+
$this->reset('body');
5555
}
5656

5757
public function render(): View
5858
{
5959
return view('livewire.discussions.add-comment');
6060
}
61-
}
61+
}

app/helpers.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,16 @@ function route_to_reply_able(mixed $replyAble): string
9191
route('discussions.show', $replyAble->slug());
9292
}
9393
}
94+
95+
if(! function_exists('getAvatar')) {
96+
/**
97+
* @param $title
98+
* @param bool $rounded
99+
*
100+
* @return string
101+
*/
102+
function getAvatar($title,bool $rounded=false): string
103+
{
104+
return 'https://ui-avatars.com/api/?name=' . urlencode($title). '&background=random&bold=true&format=svg&size=512&rounded='.$rounded;
105+
}
106+
}

0 commit comments

Comments
 (0)