In this video we are going to learn about how to Delete Product.
So let see how can we delete product.
First of open the AdminProductComponent.php Class File
And inside this file lets create a function for deleting the product.

public function deleteProduct($id)
{
$product = Product::find($id);
$product->delete();
session()->flash('message','Product has been deleted successfully!');
}


Now lets open the admin-product-component.blade.php view file and the delete link in table.


<a href=\"#\"  wire:click.prevent=\"deleteProduct({{$product->id}})\"><i class=\"fa fa-times fa-2x text-danger\" style=\"margin-left:10px;\"></i></a>


Now for displaying the success message. Before the table just add here the alert.

@if(Session::has('message'))
<div class=\"alert alert-success\" role=\"alert\">{{Session::get('message')}}</div>
@endif

Now its done so lets check it.
So switch to the browser and refresh the page.
Now lets delete any product.
So just click on delete link.
And you can see here the message product has been deleted.
So in this way you can delete product so that's all about Delete Product.