The GET method is not supported for this route. Supported methods: POST in Laravel 9 shared hosting
working with Laravel 9 and this is working fine in my localhost. but when i deploy it with shared hosting on hostgrator and click contact form it is encountered following error messages Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: POST.
I have following contact form in the blade file
The error message "The GET method is not supported for this route. Supported methods: POST" indicates that the route is only configured to accept POST requests, but a GET request was made instead. To fix this issue, change the form method from GET to POST:
<form method="post" action="{{url('form')}}#contact">
{{csrf_field()}}
<input type="hidden" name="_method" value="POST">
<!-- rest of the form -->
</form>
Also, make sure that the route is defined as a POST route in your web.php file:
What do you do at the end of the controller method? The error could be coming after the controller is method is processed, or as a result of validation error