After calling the delete() method, when trying to go to another page of the table, I get an 404 not found error.
This is my delete method:
public $selected = [];
public function deleteSelected()
{
$products = Products::whereKey($this->selected);
$products->delete();
$this->showDeleteModal = false;
$this->selected = [];
}
I tried the following
- To change the way I call the pagination inside the component's view so instead of
{{ $products->links() }}I tried{{ $products->withQueryString()->links() }} - I tried to change the
'asset_url'fromnulltohttp://localhostinconfig\livewire.php - I tried
php artisan route:clearandphp artisan route:cache
None of the above seem to fix the problem so I ended up here hoping that some of you encountered the same problem and managed to solve it.
Thanks.
/** UPDATE **/
I just rebuilt the datatable on a fresh Laravel project and I have the same error.
I made a github repo with the code if anyone interested: https://github.com/mvpopuk/livewire-datatable