Courses

Practical Livewire 3: 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.

resources/views/livewire/products-list.blade.php:

<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">
Delete
</button>

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:

  • 68 courses (1188 lessons, 43 h 18 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord