I have a very weird problem. I have a post route but I receive an error that The GET method is not supported for this route.
This is my web.php function:
Route::post('/sender',function () {
$text = request()->text;
event(new FormSubmitted($text));
});
I'm definitely sending a post request. I've already checked this: Laravel: POST method returns MethodNotAllowedHttpException
But the chosen answer is unclear.
My View Code:
<?php echo csrf_field(); ?>
{{ csrf_field() }}
<form action="/sender" method="post>
First name: <input type="text" name="fname"><br>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="text" name="content"><br>
<input type="submit">
POST
requests are not being redirected toGET
requests by your server. I recently discovered this with apache which redirected based on a trailing/
in the request url. – thisiskelvin