I am using Laravel 8 with Livewire version 2. but when I create wire:model="name"
i cannot received $name
variable value in my component
blade.php
<div>
<input type="text" wire:model="name">
Hi! My name is {{ $name }}
</div>
comment.php
class Comment extends Component
{
public $name;
public function render()
{
return view('livewire.comment');
}
}
resolved, I was using 2 divs. forgot that it should use only 1 root Element