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')
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
You can reach me out on Twitter. I'm on
Linked too
Top comments (0)