Search code examples
laravel-controllerlaravel-resource

is there any way to send METHOD value in <a> tag


when I send edit request to edit() using <a> it's working because of 'GET', but for Delete, I have to send a request for Delete Method also, How I can send it without using the form like edit

<a href="/auctions/{{$auction->id}}/edit" class="btn btn-info">Edit</a>
<form action="{{url('/auctions',$auction->id)}}" method="POST">
        @csrf
        @method('DELETE')
       <input type="submit" class="btn btn-danger"
value="Delete">
</form>

I just want to know that we can send METHOD value by <a> Or Not


Solution

  • Clicks on links via <a href="">link</a> are always GET requests and cannot be anything else.