# Delete-> Laravel

we'll be exploring how to implement a delete functionality using Laravel, one of the most popular PHP frameworks. Deleting data is a crucial aspect of any web application, and Laravel provides us with a powerful set of tools to achieve this task efficiently and securely. In this post, we'll dive into the code and see how to write a robust and scalable delete feature for our web application using Laravel's built-in features. So, if you're ready to enhance your Laravel skills, let's get started!

**Url:**

```php
<a href="{{url('/pet/delete/')}}/{{$pets->Id_Pet}}"> <button  class="sm-btn btn-danger">Danger</button></a> 
//structure
<a href="{{url('uri')}}/{{$variableofforeach -> primarykey}}"> <button  class="sm-btn btn-danger">Danger</button></a>
```

**Route:**

```php
<a href="{{ route('pet.delete'),['id'=>$pet->Id_Pet]}}"> <button  class="sm-btn btn-danger">Danger</button></a>

//structure
//<a href="{{route('uri',['parameter'=>$variableinforeach->primarykey])}}<button  class="sm-btn btn-danger">Danger</button></a>
```

### Controller

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679670871570/792195fc-d872-4217-aa18-bd0606e6ac1d.png align="center")

### web.php

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679669686652/f31ef110-9ce1-4701-b103-84a9b6a31997.png align="center")

### Pet-View

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679669758266/6763dec4-5c64-4066-bb5c-06dc4e23f53b.png align="center")

### How View Looks Like

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679671025559/0539036d-7293-4416-991f-932645077579.png align="center")

now the tiger is deleted

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1679670987215/7ed6b657-9b93-4353-adfa-4e9b0da34eed.png align="center")

***Working!***
