File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,14 +58,14 @@ protected function getFormSchema(): array
5858 /**
5959 * Launch the update function
6060 *
61- * @param Comment $comment
61+ * @param int $comment
6262 * @return void
6363 */
64- public function updateComment (Comment $ comment ): void
64+ public function updateComment (int $ comment ): void
6565 {
66- $ this ->selectedComment = $ comment ;
66+ $ this ->selectedComment = Comment:: where ( ' id ' , $ comment)-> first () ;
6767 $ this ->form ->fill ([
68- 'content ' => $ comment ->content
68+ 'content ' => $ this -> selectedComment ->content
6969 ]);
7070 $ this ->updating = true ;
7171 }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class="py-2 px-3 rounded-lg shadow hover:shadow-lg bg-primary-700 hover:bg-prima
3434 @endif
3535 @if ($comment -> owner_id === auth ()-> user ()-> id && (! $updating || $comment -> id !== $selectedComment ?-> id ) )
3636 <div class =" w-full flex flex-row justify-start items-center gap-5" >
37- <button type =" button" wire:click =" updateComment({{ $comment } } )"
37+ <button type =" button" wire:click =" updateComment(' {{ $comment -> id } }' )"
3838 class =" text-gray-400 text-xs hover:text-primary-500 flex flex-row justify-start items-center gap-1" >
3939 <i class =" fa fa-pencil" ></i > @lang (' Edit' )
4040 </button >
You can’t perform that action at this time.
0 commit comments