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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay