Practical Livewire: Order Management System Step-by-Step

In this lesson, we will delete products one by one, or by selecting and deleting in bulk. In this, we will use the same sweetalert2 package to show confirmation, as we used in categories.

First, let's make deletion work by deleting a single product, which will be identical to what we did with categories. We will start by adding action to the Delete button.


<button wire:click="deleteConfirm('delete', {{ $product->id }})" class="px-4 py-2 text-xs text-red-500 uppercase bg-red-200 rounded-md border border-transparent hover:text-red-700 hover:bg-red-300">

Now, we need to add a listener and deleteConfirm() with delete() methods to the Livewire component...

This lesson is only for Premium Members.
Want to access all lessons of this course?

You also get:

  • 50 courses (910 lessons, 46 h 42 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord