The PUT method is not supported for this route. Supported methods: GET, HEAD, POST. in laravel
Stefan Izdrail
Founder & Senior Architect · 2026-06-29
Title: Fixing PUT Method Issues for Resource Updates in Laravel Applications
In your project, you're likely facing an issue where when you click the submit button for updating a resource - be it editing or saving product details, you get the message "The PUT method is not supported for this route. Supported methods: GET, HEAD, POST." This can happen due to several reasons related to your code, routing configuration, and HTTP methods being used while creating and submitting forms.
To fix the issue, follow these steps:
1. Analyze your controller method signatures
In the given code block above, you're using `Request $request` for both `ProductController@edit()` and `ProductController@update()`. However, you should use different HTTP verbs when dealing with GET or PUT requests. In this case, change the methods' declarations to accept `GET`, `HEAD`, `POST`, respectively:
```php
public function edit($id)
{
$product = Product::find($id);
return view('product.edit', compact('product'));
}
/**
* Show the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$product = Product::find($id);
return view('product.show', compact('product'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$product = Product::find($id);
[...]
```
2. Update your `web.php` routes
Modify the routes to reflect these changes:
```php
Route::get('/index', 'ProductController@index'); // seller view all product
Route::get('/create', 'ProductController@create'); // seller create new product
Route::post('','ProductController@store')->name('product.store'); //store in database
Route::get('/edit/{id}','ProductController@edit'); // seller edit post
Route::put('{id}', 'ProductController@update')->name('product.update'); //seller update (PUT method)
```
Now, instead of using `Request $request`, you have specified the HTTP verb in your routes. This ensures that the method being called matches the corresponding route and prevents any discrepancies between the submitted request's method and the code handling it. The `{id}` parameter in the `Route::put('{id}', ...)` allows for a direct mapping from URL to the controller method, improving readability and maintainability of your Laravel application.
3. Change the form action attribute
Finally, alter your edit.blade.php file's form code:
```html