I have an edit modal ( bootstrap ) everything is ok but I don’t find any event to close my modal after saving changes?
<!-- Modal -->
<div class="modal fade" id="editPost{{ $post->id }}">
<div class="modal-dialog" role="document">
<div class="modal-content">
<livewire:posts.post-modal :post="$post" :key="$post->id">
</div>
</div>
</div>
php code:
public $post;
public $name;
public $desc;
public function mount($post)
{
$this->post = $post;
$this->name = $post->name;
$this->desc = $post->desc;
}
public function editPost($id)
{
$validatedData = $this->validate([
'name' => 'required|unique:posts,name,'.$id,
'desc' => 'required',
]);
auth()->user()->posts()->where('id',$id)->update($validatedData);
session()->flash('message', 'Post successfully Added.');
$this->emit('postUpdated');
}
Is there any event to close the modal in livewire?