I am making a comment system, livewire works correctly in other parts of the system but when I want to edit a comment the wire:model does not receive the information, however if I print the variable on the view it shows it correctly.
I show the code of the component:
public $editComment;
public function edit(Comment $comment)
{
$this->editComment = $comment;
}
public function mount()
{
$this->editComment = new Comment();
}
I show the view :
@if($comment->user_id == Auth::user()->id)
<i title="Editar mensaje" wire:click="edit({{$comment}})" class="fas fa-edit"></i>
<i wire:click.prevent="confirmDelete({{$comment}})" title="Borrar mensaje" class="far fa-trash-alt"></i>
@endif
</div>
@if($comment->id == $editComment->id)
{{$editComment}} {{-- Here it shows it correctly --}}
<form wire:submit.prevent="update">
<input wire:model="editComment" type="text">