DEV Community

Chidiebere Chukwudi
Chidiebere Chukwudi

Posted on • Edited on

2

[Solved] The POST method is not supported for this route. Supported methods: GET, HEAD. Laravel

Quick Solution and straight to the point no bulky intro(this is my intro though)

Solution: If you are trying to make an update request and you are using laravel route resource to manage your routing, this solution should work for you

<form action="{{ route('article.update', $article->id) }}" method="POST">
 @csrf
@method('PUT')
Enter fullscreen mode Exit fullscreen mode

Noticed the @method('PUT') ? This is because laravel resource route natviely uses the "PUT" verb for handling your form actions.

Hint:
If you defined the route by yourself with out the route resource, you can make use of the "POST" verb and it will definitely work!

For example:

<form action="/articles/update/{{$article->id}}" method="POST">
        @csrf
Enter fullscreen mode Exit fullscreen mode

You can reach me out on Twitter. I'm on
Linked too

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more