I am getting this error on form submission:
The POST method is not supported for this route. Supported methods: GET, HEAD.
Here is the form code:
<form action="bid" method = "POST" >
@csrf
<h2>
Your Bid
</h2>
<h4 style="font-size:15px;color:antiquewhite">Days</h4>
<input type="number" name="days" placeholder=" Your Days to complete project" class="form-input"><br />
<h4 style="font-size:15px;color:antiquewhite">Cost</h4>
<input type="number" name="cost" placeholder="Your bid cost in $ doller" class="form-input"><br />
<button class="btnn-U" type="submit">Send</button>
</form>
and here is the Route code:
Route::post('bid','AppHttpControllersregister@bid');
I have tried using php artisan route:cache
2
Answers
The first thing, a recommendation, write your routes like this and give your route any name;
And call this route with name;
<form action="/bid" method = "POST" >
Tried different things but ultimately this solved my problem.