The GET method is not supported for this route. Supported methods: PATCH. This error occurs when you are trying to put the patch method in the form method attribute and then submit your form.
Basically the HTML not support the different method in the form that what provided by the laravel different methods.
That's why we need to bind that other method inside the blade file form using laravel attributes like @method('PATCH').
Here is the solution on how to handle all the different routes method in HTML form in the blade file laravel.
Route
This is my route-defined URL user/registration. Where I used the patch method for this route method request.
Route::patch('user/registration','HomeController@index')->name('user.register');
Form Method Handled
This is the form, Inside the form method attribute i used post method, But inside the form i have define patch method. So that route can access patch method from the form request.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Webappfix</title> </head> <body> // add post method in form method attribute instead of patch <form action="{{ route('user.register') }}" method="post"> @method('PATCH') // add Patch method form @csrf <label for="name">Name :</label> <input name="name" id="name" type="text"> <label for="email">Email :</label> <input name="email" id="email" type="email"> <label for="mobile">Mobile :</label> <input name="mobile" id="mobile" type="mobile"> <input type="submit"> </form> </body> </html>
We always thanks to you for reading our blogs.
Dharmesh Chauhan
(Swapinfoway Founder)Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us
Haresh Chauhan
(Co-Founder)We Are Also Recommending You :
- resize image and upload example laravel intervention
- How to Install Laravel 10 With Video Tutorial
- Import Export Database in JSON Format Laravel
- Laravel One to Many Eloquent Relationship Tutorial With Example
- Laravel 6 Image Upload Tutorial
- Laravel Carbon diffForHumans Arguments Passing
- How to return laravel collection in json format - toJson() Method - Laravel Collection
- Create Custom Route File With New Service Provider Laravel 8 9
- Get Current Route Name Laravel
- Casting Attribute in Laravel Eloquent Models